/python3-mega

Wrapper around the Mega API - python3 version

Primary LanguagePython

python-mega

Build Status

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 = 'kim@dot.com'
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 MEGAEMAIL=kim@dot.com
$ 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