Skip to main content

Banker

Banker is a wrapper around nordigen APIs in order to obtain banking transactions. To use Banker, it is necessary to create an account at nordigen and obtain individual secret keys, more on that below.

Installation

pip3 install banker

Usage

1. First time setup

To use Banker, it is first required to sign up at nordigen and thereafter create secret keys at the following link. Afterwards, a auth.yaml file can be generated using the following, together with the generated secret_id and secret_key from nordigen.

>>> import banker 

>>> secret_id = "SECRET_ID_FROM_NORDIGEN"
>>> secret_key = "SECRET_KEY_FROM_NORDIGEN"

>>> client = banker.Client()
>>> client.add_keys(secret_id, secret_key)

After running the above, an auth.yaml file will be created in the same folder. It is no longer necessary to use the secret_id and secret_key since everything will be stored in the auth.yaml file.

2. Create and sign agreement with a bank.

Next, we would like to create a connection with a single bank. In order to do this, a unique id for an institution is needed. In this example, we are interested in connecting all accounts from Swedbank (if you have any), which can be done in the following way.

>>> client = banker.Client()
# We need to find the unique institution_id for swedbank.
>>> client.search_institution("swedbank")
[{'id': 'SWEDBANK_SWEDSESS',
  'name': 'Swedbank',
  'bic': 'SWEDSESS',
  'transaction_total_days': '730',
  'countries': ['SE'],
  'logo': 'https://cdn.nordigen.com/ais/SWEDBANK_LONG_SWEDSESS.png',
  'payments': False}]

# With the 'id' above we can submit a requisition and sign an agreement. Open the following link and proceed to sign the agreement. 
>>> client.submit_requisition("SWEDBANK_SWEDSESS")
'https://ob.nordigen.com/psd2/start/..../SWEDBANK_SWEDSESS'

3. List available accounts and get transactions, balances, etc.

Now it is possible to list all accounts that are available from the banks that you have signed an agreement with.

>>> client.accounts()
{'SWEDBANK_SWEDSESS': ['YOUR_SWEDBANK_ACCOUNT_ID_1', 'YOUR_SWEDBANK_ACCOUNT_ID_2'], 'NORWEGIAN_SE_NORWNOK1': ['YOUR_NORWEGIAN_ACCOUNT_ID_1']}

# With one account_id above, get all transactions from the last 90 days.
>>> client.transactions("YOUR_ACCOUNT_ID")
A lot of output, which varies between different banks.

# It is also possible to obtain account balance.
>>> client.account_balance("YOUR_ACCOUNT_ID")
{'balances': [{'balanceAmount': {'amount': 'AMOUNT_HERE', 'currency': 'SEK'}, 'balanceType': 'interimAvailable'}, {'balanceAmount': {'amount': 'AMOUNT_HERE', 'currency': 'SEK'}, 'balanceType': 'interimBooked'}]}

Release files for banker 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for banker 0.1.0
File Size Uploaded
banker-0.1.0.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for banker 0.1.0
File Interpreter ABI Platform
banker-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.3 kB

Release files / banker-0.1.0.tar.gz

Download URL banker-0.1.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
48ada99498b771f6030ec46328cee64fc79abe1540ca020a4d51bc0fbbc25a0b
BLAKE2b-256 checksum
How to use checksums
ca925de9295d4e2e3681e5ef65be6d1a1fea1fa28b71afbbfa9a22d56243377e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.10.4 Darwin/21.5.0

Release files / banker-0.1.0-py3-none-any.whl

Download URL banker-0.1.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4fcd069dea9cd0b6ea8a22cdb12a72c4cf96b485856d0858750848f30a41eca
BLAKE2b-256 checksum
How to use checksums
48228abd0145e9b0e8c7e33971ce30bbf737422c8db8144d53292989f1fe04fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.10.4 Darwin/21.5.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page