Skip to main content
Help us improve Python packaging – donate today!

MangoPay API

Project Description

MangoPay SDK
=================================================
MangoPaySDK is a python client library to work with
[MangoPay REST API](http://docs.mangopay.com/api-references/).


Installation
-------------------------------------------------
SDK has been written in Python 3.3
and depends on requests and requests-oauthlib packages.

We strongly recommend using PIP as installation method:

pip install mangopaysdk


License
-------------------------------------------------
MangoPaySDK is distributed under MIT license, see LICENSE file.


Unit Tests (not included in pip package)
-------------------------------------------------

cd project_directory

# discovers and runs ALL tests:
python -m unittest

# runs single module/class/method:
python -m unittest test_module1 test_module2
python -m unittest test_module.TestClass
python -m unittest test_module.TestClass.test_method


Contacts
-------------------------------------------------
Report bugs or suggest features using
[issue tracker at GitHub](https://github.com/MangoPay/mangopay2-python-sdk).


Sample usage
-------------------------------------------------

from mangopaysdk.mangopayapi import MangoPayApi
api = MangoPayApi()

# get some user by id
john = api.users.Get(someId)

# change and update some of his data
john.LastName += " - CHANGED"
api.users.Update(john)

# get all users (with pagination)
from mangopaysdk.types.pagination import Pagination
pagination = Pagination(1, 8) # get 1st page, 8 items per page
users = api.users.GetAll(pagination)

# get his bank accounts
pagination = Pagination(2, 10) # get 2nd page, 10 items per page
accounts = api.users.GetBankAccounts(john.Id, pagination)


Client creation example (you need to call it only once)
-------------------------------------------------

from mangopaysdk.mangopayapi import MangoPayApi
api = MangoPayApi()

client = api.clients.Create('your-client-id', 'your-client-name', 'your-client-email@sample.org')
print(client.Passphrase) # you receive your password here


Configuration example
-------------------------------------------------

from mangopaysdk.mangopayapi import MangoPayApi
api = MangoPayApi()

api.Config.ClientId = 'your-client-id'
api.Config.ClientPassword = 'your-client-password'
print(api.Config.BaseUrl) # you probably dont have to change it

# call some API methods...
users = api.users.GetAll()


Example with auth token reusage
-------------------------------------------------

from mangopaysdk.mangopayapi import MangoPayApi
api = MangoPayApi()

# optionally you can reuse token from previous requests (unless expired)
api.OAuthToken = myTokensPersistenceService.loadIfStored()

# call some API methods...
users = api.users.GetAll()

# optionally store the token for future requests (until expires)
myTokensPersistenceService.store(api.OAuthToken)

Release history Release notifications

History Node

3.4.0

History Node

3.3.1

History Node

3.3.0

History Node

3.2.1

History Node

3.2.0

History Node

3.1.1

History Node

3.1.0

History Node

3.0.6

History Node

3.0.5

History Node

3.0.4

History Node

3.0.3

History Node

3.0.2

History Node

3.0.1

History Node

3.0.0

History Node

3.0.dev3

History Node

3.0.dev2

History Node

2.1.1

History Node

2.1.0

History Node

2.0

History Node

1.9

History Node

1.8

History Node

1.5.2

History Node

1.5.1

History Node

1.5

History Node

0.311

History Node

0.32

History Node

0.31

History Node

0.3

History Node

0.2.5

History Node

0.2.2

History Node

0.2.1

History Node

0.1.9

This version
History Node

0.1.8

History Node

0.1.7

History Node

0.1.6

History Node

0.1.5

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
mangopaysdk-0.1.8.zip (31.8 kB) Copy SHA256 hash SHA256 Source None Sep 11, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page