Skip to main content

Asynchronous Python wrapper around BML API

Project description

Async BML API

Python Version aiobml · PyPI PyPI - Status Maintenance LICENSE

ViewCount GitHub forks GitHub stars contributions welcome GitHub issues

This is an asynchronous Python wrapper around the Bank of Maldives API. This library is not yet fully compeleted. As of now it only can be used to get the transactions done within the last 24 - 48 hours. scroll to the end to see the to do list of this library

How it works

Its a simple asynchronous Python wrapper around the BML API that returns the transaction history of all your Bank of Maldives accounts. If you want to check for new transactions, save the transactions to a db, check and add any transactions that's not currently saved to the db.

setup

You must have python 3 installed

using PIP

$ pip install -U aiobml

From Source

$ git clone https://github.com/quillfires/aioBML.git

$ cd aioBML

$ python setup.py install

Basic Example

import asyncio

from aiobml import asyncBML

loop = asyncio.get_event_loop()
bank = asyncBML(username="your_user_name",password="your_password")

async def main():
    while True:
        history = await bank.get_history()
        # will return a dict object for any of your account
        # that has a transaction in 24 to 48 hours. 
        # {account1:[{transaction1},{trabsaction2}],}
        # detailed example of one account with one transaction:
        # {'ACCOUNT NUMBER': 
        #     [
        #         {
        #             'date': 'date', 
        #             'sender': 'sender name', 
        #             'amount': 'amount', 
        #             'minus': True/False, 
        #             'balance': 'balance', 
        #             'description': 'Transfer Credit or Transfer Debit'
        #         }, 
        #     ],
        # }
        if history:
            for accounts in history:
                for transaction in history[accounts]:
                    print(transaction)
                    #check if it is in your db
                    # if not, save to db and alert about the transaction
        await asyncio.sleep(30) # keep checking


if __name__ == '__main__':
    try:
        loop.run_until_complete(main())
    except (KeyboardInterrupt, SystemExit):
        pass
    finally:
        loop.run_until_complete(bank.close())

Todo

  • Get todays history
  • Get history from a date range
  • Make Transfer to a given account number
  • Add contacts
  • Delete contacts
  • Make transfers to contacts.

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

aiobml-0.1.2.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

aiobml-0.1.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file aiobml-0.1.2.tar.gz.

File metadata

  • Download URL: aiobml-0.1.2.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for aiobml-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b93754c46607f13222476bb0ab2daa0cbeed0bd3f1084ffa89a2e0173ff75e5e
MD5 32d1bc1809f03472ce8b1f2de0164135
BLAKE2b-256 9c687a7a1a82a2dabc1c835657b3c27c52c8b8f568a6846159b7a61dd502eac0

See more details on using hashes here.

File details

Details for the file aiobml-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: aiobml-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for aiobml-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ee99b809df1f2f6051ee9469434a49d00b6bce8c506a1b86c6e2fbe7feefc6dd
MD5 47a1817f80fb38b8496a057ad24332ce
BLAKE2b-256 ea92cd5a5815aa739f78f976217548268280771315fd75267cd95d5cd1b30841

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