python3-mega
python3-mega copied to clipboard
Wrapper around the Mega API - python3 version
python-mega
Overview
Wrapper around the Mega API. Based on the work of Julien Marchand.
This is a fork of Juan Riaza's github project, which is not maintained anymore.
Installation
Install using pip
, including any optional packages you want...
$ pip install python3-mega
...or clone the project from github.
$ git clone git@jeroenmeulenaar/python3-mega.git
$ cd python3-mega
$ pip install -r requirements.txt
How to use it?
With your credentials:
from mega import Mega
email = '[email protected]'
password = 'olakase'
m = Mega.from_credentials(email, password)
…or you can use an ephemeral account:
m = Mega.from_ephemeral()
And fire some requests:
# list of files
files = m.get_files()
# download a file
m.download_file(file_id, file_key)
# upload a file
m.uploadfile('/home/kim/mega/secret_plans')
# download from an url
m.download_from_url('https://mega.co.nz/#!wYo3AYZC!Zwi1f3ANtYwKNOc07fwuN1enOoRj4CreFouuGqi4D6Y')
Running the tests
$ export [email protected]
$ export MEGAPASSWORD=olakase
$ python tests.py
Acknowledgements
- Many thanks to Julien Marchand for the initial work.
- All of the contributors to the original github project