Skip to main content

a python wrapper for the Mono API

Project description

MonoPY

[Unofficial] python wrapper for making requests to the Mono API and a webhook implementation.

Github Link: monopy

Features

  • Account endpoints [transaction log, statament (json or pdf format)]
  • User endpoints [transaction, income and identity]
  • Unlink Account
  • Misc.

How to Get Started

You would need to get your mono secret key here, and then move to acquire an account ID via the many Mono Connect options.

Installation & Usage Guide

pip install monopy

SET YOUR KEYS IN YOUR ENVIRONMENT

Open up your CMD (replace set with export if you are on MAC/LINUX)

set TEST_MONO_SEC_KEY=test_sk_xxxxxxxxxxxxxx
set acc_ID=xxxxxxxxxxxxxxxxx

#Making Requests

from mono.api import Account, UserMono, Misc, DirectPay

User Client

mono_user = UserMono(mono_sec_key='xxxxxxxxxxxxxxxx')


# Get Transaction logs
mono_user.transaction(id='xxxxxxxxxxx')
A successful response (status code: 200), otherwise {} (status code: 400)
{
  "paging": {
    "total": 190,
    "page": 2,
    "previous": "https://api.withmono.com/accounts/:id/transactions?page=2",
    "next": "https://api.withmono.com/accounts/:id/transactions?page=3",
  },
  "data": [
    {
      "_id": "xxxxxxxxxxxxxxxxxxxx",
      "amount": 10000,
      "date": "2020-07-21T00:00:00.000Z",
      "narration": "TRANSFER from Emmanuel to Fred",
      "type": "debit",
      "category": "E-CHANNELS",
    },
    ...,
  ]
}
Get income
mono_user.income(id='xxxxxxxxxxxx')

Account

py_acc = Account(mono_sec_key='xxxxxxxxxxxxxxxx')

# this represents the account details with the financial institution.
py_acc.information(id='xxxxxxxxxx')
A successful response (status code: 200), otherwise {} (status code: 400)
{
    "meta": {
        "data_status": "AVAILABLE", 
        "auth_method": "mobile_banking" 
    },
    "account": {
        "_id": "5feec8ce95e8dc6axxxxxx",
        "institution": {
            "name": "GTBank",
            "bankCode": "058",
            "type": "PERSONAL_BANKING"
        },....}
}

Misc

Get all institutions currently available on Mono

misc = Misc(mono_sec_key='xxxxxxxxxxxxxxx)


misc.institutions()

A successful reponse is as follow (truncated here)

[
    {'name': 'Brass', 'icon': 'https://mono-public-bucket.s3.eu-west-2.amazonaws.com/images/brass_logo.jpeg', 'coverage': {'countries': ['NG'], 'business': True, 'personal': False}, 'products': ['Auth', 'Accounts', 'Transactions', 'Balance', 'Income', 'Identity'], 'website': None}, {'name': 'Ecobank', 'icon': 'https://mono-public-bucket.s3.eu-west-2.amazonaws.com/images/ecobank-icon.png', 'coverage': {'countries': ['NG'], 'business': False, 'personal': True}, 'products': ['Auth', 'Accounts', 'Transactions', 'Balance', 'Income', 'Identity'], 'website': None},
    .....
    {'name': 'Cowrywise', 'icon': 'https://mono-public-bucket.s3.eu-west-2.amazonaws.com/images/cowrywise-icon.png', 'coverage': {'countries': ['NG'], 'business': False, 'personal': True}, 'products': ['Auth', 'Accounts', 'Transactions', 'Balance', 'Income', 'Identity'], 'website': 'https://cowrywise.com'},
    {'name': 'Polaris Bank', 'icon': 'https://mono-public-bucket.s3.eu-west-2.amazonaws.com/images/polaris-bank-icon.png', 'coverage': {'countries': ['NG'], 'business': False, 'personal': True}, 'products': ['Auth', 'Accounts', 'Transactions', 'Balance', 'Income', 'Identity'], 'website': 'https://www.polarisbanklimited.com'}
]

Contribution

Kindly adhere to the following rules:

  • fork the repo
  • make your changes on a descriptive branch name
  • ....and make a pull request ONLY when your tests pass.

Author

Project details


Download files

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

Source Distribution

monopy-1.0.3.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

monopy-1.0.3-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file monopy-1.0.3.tar.gz.

File metadata

  • Download URL: monopy-1.0.3.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.6

File hashes

Hashes for monopy-1.0.3.tar.gz
Algorithm Hash digest
SHA256 bd2ac6c88e56b978dedd3c9c76b6a316cdf8676ae063a8f6cc8b04022348f9ac
MD5 2e3d36e8ed82d49bd1586f99b338b023
BLAKE2b-256 a0e086f7c14a8f02840f95e14980d1d8d65252341a5abf1c08c73050e6997e59

See more details on using hashes here.

File details

Details for the file monopy-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: monopy-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.6

File hashes

Hashes for monopy-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a60a8bcb48d8a45bb8c5545e720031e106c84b7b26f7c6aecb29e395160cfa83
MD5 fa236a631c87409a07d431a65da2f253
BLAKE2b-256 f90482e2fccb9f3115e31192d00d3c2d6a3a86c0e30f7e3e8ecf353d21e0f402

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page