Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonvc/mondo-python
Python wrapper for the Mondo API. Forked from https://bitbucket.org/titomiguelcosta/mondo
https://github.com/simonvc/mondo-python
Last synced: 30 days ago
JSON representation
Python wrapper for the Mondo API. Forked from https://bitbucket.org/titomiguelcosta/mondo
- Host: GitHub
- URL: https://github.com/simonvc/mondo-python
- Owner: simonvc
- Created: 2015-11-26T11:52:09.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-03T19:51:11.000Z (almost 9 years ago)
- Last Synced: 2024-08-03T18:19:27.241Z (4 months ago)
- Language: Python
- Size: 28.3 KB
- Stars: 16
- Watchers: 4
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-monzo - mondo-python - A simple python SDK for dealing with the Mondo API (Code & Client Libraries)
README
# Mondo simple python SDK
A simple python SDK for dealing with the Mondo API
It deals with tokens and token refreshing behind the scenesSee the docs https://getmondo.co.uk/docs for details.
1. Download the repository
2. Use the SDK for fun, profit, and global domination## How do I load the SDK
All of the methods in the class can accept different account details as parameters,
should you open up your app / service to other people, but starting with your own account and
defaults makes it easy to play with.You can also specify the default account details to use in the instantiation of MondoClient.
```
account = MondoClient('[email protected]', 'p4ssw0rd', 'oauthclient_xxxx', 'client_secret')
```
If that goes well and you don't get any errors...## What can you do?
* account.get_transactions()
* account.get_transaction()
* account.authenticate()
* account.get_accounts()
* account.get_primary_accountID()
* account.create_feed_item()
* account.register_webhook()
* account.deliver_token()
* account.token_refresh()deliver_token() returns a token for handrolling requests and refreshes it when necessary
The methods above all return JSON rather than request objects (the previous version)
Look at the code and https://getmondo.co.uk/docs for information on what parameters to use
to refer to other accounts etc.## What about tokens and refreshing them?
It's all taken care of.
If a token expires the code will use the refresh call to get a new one## Example starter code
```
from mondo import MondoClient
account = MondoClient('[email protected]', 'p4ssw0rd', 'oauthclient_xxxx', 'client_secret')print(account.get_accounts())
first_account_id = account.get_accounts()[0]['id']trx = account.get_transactions(account.get_primary_accountID(), limit=10)
print(trx)singleID = trx[1]['id']
single = account.get_transaction(singleID)
print(single)account.register_webhook(url='http://mydomain.com/transactions')
webhooks = account.list_webhooks()
first_webhook = webhooks[0]['id']account.delete_webhook(first_webhook)
```Evolved from original code by Tito Miguel Costa ( https://bitbucket.org/titomiguelcosta/mondo )