Skip to main content

Client library to support the Canadian Imperial Bank of Canadas API

Project description

CIBC API Client Wrapper

This package provides a client wrapper around CIBC's API. CIBC uses one API to handle requests from their web platform and app, specifically the API passes information about accounts, and transactions in those accounts. This Wrapper makes it easy to gather that data in python, given the primary account card number and password. Essentially, online banking through python.

Getting Started

Prerequisites

built for python 3.0 +, any operating system

pip install cibc

Basic Usage

Start with logging into a CIBC account by calling the cibc.CIBC method using your username and login

import cibc
c = cibc.CIBC('username (usually card number)', 'password')

Next, grab the accounts associated with this username and password (this is required, for any account specific information)

c.Accounts()
accounts = c.accounts

The accounts, which is a list of account class', is now storing all the account specific information. I'm no entirely sure what all of it is, but the account class variables are listed below. To get the transactions:

c.gTransactions(dateFrom=datetime.datetime(year=2018, month=9,day=1),dateUntil= datetime.datetime(year=2018, month=9, day=17))	

the gTransactions method gets all the transactions for all the accounts in the instance. It is also easy to get them one by one using the aquireTransactions method as follows:

for account in accounts:
	print(account.aquireTransactions())

which will return a list of transactions, each transaction being a dictionary of details.

Finally, there's an easy built in way to send the account transaction details to a csv file, or simply get a list of dictionaries without re-acquiring every transaction using the .tocsv() and .tolist() methods:

for account in accounts:
    account.tocsv('C:\Users\louis\Desktop\{}.csv'.format(account))
    print(account.tolist())

Summing and Subtracting Accounts

For your convenience, there's an easy way to combine accounts for looking at all transactions at once. The addition and subtraction methods are well defined for account classes and can be used like this:

omniAccount = sum(c.accounts) # all the account transactions in one account.  Account specific variables are lost
nomniAccount = c.accounts[0] - c.accounts[1]

Account subtraction returns an account instance with a balance of the first account balance minus the other account balance. It also holds the list of transactions excluding ones in account 1 that are also in account 2.

Contributing

thanks CIBC, for the API as well as being big enough for this to be relevant.

Versioning

We use (http://semver.org/) for versioning. For the versions available, see the (https://github.com/louismillette/CIBC).

Authors

  • Louis Millette

License

This project is licensed under the MIT License

Acknowledgments

  • CIBC. It's a good bank.

Notice

I have been informed that useing this repository is a violation of the terms of service for CIBC's online banking agreement.

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

cibc-0.3.5.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

cibc-0.3.5-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file cibc-0.3.5.tar.gz.

File metadata

  • Download URL: cibc-0.3.5.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.3.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for cibc-0.3.5.tar.gz
Algorithm Hash digest
SHA256 38d0479212da71684809c115c61104bbddeb6893a06adebce608d01fe6645ee6
MD5 2f7a1d590190a9034b97182fc5dfcd23
BLAKE2b-256 429584f032adf9270fd89f18c468cf950e5417869ebaf897071b6f4799fb6f22

See more details on using hashes here.

File details

Details for the file cibc-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: cibc-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.3.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for cibc-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f6b5dbc18543c324d36ea1357de10c1976a6e9ad05a28c6cc9b5bfe8a41492c6
MD5 74fcfc508233974c7c134a860cdc2302
BLAKE2b-256 f5cdab198e1270ae7d1ade848d40431eae7a336b2af8e44aa85bfd89053289c1

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