Fio Bank API in Python
Project description
Fio Bank API in Python.
Installation
$ pip install fiobank
Usage
First, get your API token. Initialization of the client:
>>> from fiobank import FioBank >>> client = FioBank(token='...')
Account information:
>>> client.info() { 'currency': 'CZK', 'account_number_full': 'XXXXXXXXXX/2010', 'balance': 42.00, 'account_number': 'XXXXXXXXXX', 'bank_code': '2010' }
Listing transactions within a period:
>>> gen = client.period('2013-01-20', '2013-03-20') >>> list(gen)[0] { 'comment': 'N\xe1kup: IKEA CR, BRNO, CZ, dne 17.1.2013, \u010d\xe1stka 2769.00 CZK', 'recipient_message': 'N\xe1kup: IKEA CR, BRNO, CZ, dne 17.1.2013, \u010d\xe1stka 2769.00 CZK', 'user_identification': 'N\xe1kup: IKEA CR, BRNO, CZ, dne 17.1.2013, \u010d\xe1stka 2769.00 CZK', 'currency': 'CZK', 'amount': -2769.0, 'instruction_id': 'XXXXXXXXXX', 'executor': 'Vilém Fusek', 'date': datetime.date(2013, 1, 20), 'type': 'Platba kartou', 'transaction_id': 'XXXXXXXXXX' }
Listing transactions from a single account statement:
>>> client.statement(2013, 1) # 1 is January only by coincidence - arguments mean 'first statement of 2013'
Listing the latest transactions:
>>> client.last() # return transactions added from last listing >>> client.last(from_id='...') # sets cursor to given transaction_id and returns following transactions >>> client.last(from_date='2013-03-01') # sets cursor to given date and returns following transactions
Conflict Error
Fio API documentation (Section 8.2) states that a single token should be used only once per 30s. Otherwise, an HTTP 409 Conflict will be returned and fiobank.ThrottlingError will be raised.
Contributing
$ pip install -e .[tests] $ pytest
Changelog
See GitHub Releases.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size fiobank-3.0.0-py2.py3-none-any.whl (5.0 kB) | File type Wheel | Python version py2.py3 | Upload date | Hashes View |
Filename, size fiobank-3.0.0.tar.gz (5.1 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for fiobank-3.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b335210f92be648342ee879a1156e8fb450ff1d059f6e8757c857611a55ef26 |
|
MD5 | 45cfbca8524a3f5571a682e9abc9200a |
|
BLAKE2-256 | 0583acaf495058b8b59b3937ebea32825483e3e15fa762a0c43beeaace57b33b |