All Projects → odwyersoftware → Mega.py

odwyersoftware / Mega.py

Licence: apache-2.0
Python library for the https://mega.nz/ API.

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects
python2
120 projects

Projects that are alternatives of or similar to Mega.py

Slack
🎉✨ Slack API client for Node and browsers.
Stars: ✭ 903 (+522.76%)
Mutual labels:  api-client, api-wrapper
Wikipedir
R's MediaWiki API client library
Stars: ✭ 54 (-62.76%)
Mutual labels:  api-client, api-wrapper
Groovehq
Ruby gem for GrooveHQ api
Stars: ✭ 22 (-84.83%)
Mutual labels:  api-client, api-wrapper
Bitly
A Ruby wrapper for the bit.ly API
Stars: ✭ 435 (+200%)
Mutual labels:  api-client, api-wrapper
Zbox
Zero-details, privacy-focused in-app file system.
Stars: ✭ 1,185 (+717.24%)
Mutual labels:  storage, encryption
Pizzly
The simplest, fastest way to integrate your app with an OAuth API 😋
Stars: ✭ 796 (+448.97%)
Mutual labels:  api-client, api-wrapper
Awesome Scalability Toolbox
My opinionated list of products and tools used for high-scalability projects
Stars: ✭ 34 (-76.55%)
Mutual labels:  storage, encryption
cl-kraken
A Common Lisp API wrapper for the Kraken cryptocurrency exchange.
Stars: ✭ 12 (-91.72%)
Mutual labels:  api-client, api-wrapper
Newsapi
A python wrapper for News API.
Stars: ✭ 71 (-51.03%)
Mutual labels:  api-client, api-wrapper
Avenue
Wrapper around URLSession and URLSessionTask to enable seamless integration with Operation / OperationQueue.
Stars: ✭ 58 (-60%)
Mutual labels:  api-client, api-wrapper
Hawk
✔️ Secure, simple key-value storage for Android
Stars: ✭ 3,827 (+2539.31%)
Mutual labels:  storage, encryption
Instagram api gem
A Ruby wrapper for the Instagram API
Stars: ✭ 100 (-31.03%)
Mutual labels:  api-client, api-wrapper
Kissme
Kissme: Kotlin Secure Storage Multiplatform
Stars: ✭ 351 (+142.07%)
Mutual labels:  storage, encryption
Peergos
A p2p, secure file storage, social network and application protocol
Stars: ✭ 895 (+517.24%)
Mutual labels:  storage, encryption
Hubspot Php
HubSpot PHP API Client
Stars: ✭ 273 (+88.28%)
Mutual labels:  api-client, api-wrapper
Apipie
Transform api declaration to js object for frontend. Inspired by VueRouter, koa-middleware and axios.
Stars: ✭ 29 (-80%)
Mutual labels:  api-client, api-wrapper
pushover
Go wrapper for the Pushover API
Stars: ✭ 112 (-22.76%)
Mutual labels:  api-client, api-wrapper
kaggler
🏁 API client for Kaggle
Stars: ✭ 50 (-65.52%)
Mutual labels:  api-client, api-wrapper
Github
Ruby interface to GitHub API
Stars: ✭ 1,081 (+645.52%)
Mutual labels:  api-client, api-wrapper
Wsend Gpg
Encrypted end to end file transfer
Stars: ✭ 97 (-33.1%)
Mutual labels:  storage, encryption

Mega.py

Build Status Downloads PyPI version

Python library for the Mega.co.nz API, currently supporting:

  • login
  • uploading
  • downloading
  • deleting
  • searching
  • sharing
  • renaming
  • moving files

This is a work in progress, further functionality coming shortly.

For more detailed information see API_INFO.md

How To Use

Create a Mega account

First, create an account with Mega .

Install mega.py package

Run the following command, or run setup from the latest github source.

pip install mega.py

Import mega.py

from mega import Mega

Create an instance of Mega.py

mega = Mega()

Login to Mega

m = mega.login(email, password)
# login using a temporary anonymous account
m = mega.login()

Get user details

details = m.get_user()

Get account balance (Pro accounts only)

balance = m.get_balance()

Get account disk quota

quota = m.get_quota()

Get account storage space

# specify unit output kilo, mega, gig, else bytes will output
space = m.get_storage_space(kilo=True)

Get account files

files = m.get_files()

Upload a file, and get its public link

file = m.upload('myfile.doc')
m.get_upload_link(file)
# see mega.py for destination and filename options

Export a file or folder

public_exported_web_link = m.export('myfile.doc')
public_exported_web_link = m.export('my_mega_folder/my_sub_folder_to_share')
# e.g. https://mega.nz/#F!WlVl1CbZ!M3wmhwZDENMNUJoBsdzFng

Find a file or folder

folder = m.find('my_mega_folder')
# Excludes results which are in the Trash folder (i.e. deleted)
folder = m.find('my_mega_folder', exclude_deleted=True)

Upload a file to a destination folder

folder = m.find('my_mega_folder')
m.upload('myfile.doc', folder[0])

Download a file from URL or file obj, optionally specify destination folder

file = m.find('myfile.doc')
m.download(file)
m.download_url('https://mega.co.nz/#!utYjgSTQ!OM4U3V5v_W4N5edSo0wolg1D5H0fwSrLD3oLnLuS9pc')
m.download(file, '/home/john-smith/Desktop')
# specify optional download filename (download_url() supports this also)
m.download(file, '/home/john-smith/Desktop', 'myfile.zip')

Import a file from URL, optionally specify destination folder

m.import_public_url('https://mega.co.nz/#!utYjgSTQ!OM4U3V5v_W4N5edSo0wolg1D5H0fwSrLD3oLnLuS9pc')
folder_node = m.find('Documents')[1]
m.import_public_url('https://mega.co.nz/#!utYjgSTQ!OM4U3V5v_W4N5edSo0wolg1D5H0fwSrLD3oLnLuS9pc', dest_node=folder_node)

Create a folder

m.create_folder('new_folder')
m.create_folder('new_folder/sub_folder/subsub_folder')

Returns a dict of folder node name and node_id, e.g.

{
  'new_folder': 'qpFhAYwA',
  'sub_folder': '2pdlmY4Z',
  'subsub_folder': 'GgMFCKLZ'
}

Rename a file or a folder

file = m.find('myfile.doc')
m.rename(file, 'my_file.doc')

Contact Support

For paid priority support contact [email protected].

UK Python Development Agency

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].