Fio Bank API in Python (unofficial)
Project description
Fio Bank API in Python.
Installation
From PyPI:
pip install fiobank
In case you have an adventurous mind, give a try to the source:
pip install git+https://github.com/honzajavorek/fiobank.git#egg=fiobank
Usage
First, get your API token.
Initialization of the client:
>>> from fiobank import FioBank
>>> client = FioBank(token='...', decimal=True)
Account information:
>>> client.info()
{
'currency': 'CZK',
'account_number_full': 'XXXXXXXXXX/2010',
'balance': Decimal('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': Decimal('-2769.0'),
'instruction_id': 'XXXXXXXXXX',
'executor': 'Vilém Fusek',
'date': datetime.date(2013, 1, 20),
'type': 'Platba kartou',
'transaction_id': 'XXXXXXXXXX'
}
Getting transactions with account information in one request:
>>> client.transactions('2013-01-20', '2013-03-20')
(
{'currency': 'CZK', 'account_number_full': 'XXXXXXXXXX/2010', 'balance': 42.00, 'account_number': 'XXXXXXXXXX', 'bank_code': '2010'},
'transactions': <generator object _parse_transactions at 0x170c190>
)
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
Getting the latest transactions with account information in one request:
>>> client.last_transactions()
(
{'currency': 'CZK', 'account_number_full': 'XXXXXXXXXX/2010', 'balance': 42.00, 'account_number': 'XXXXXXXXXX', 'bank_code': '2010'},
'transactions': <generator object _parse_transactions at 0x170c190>
)
Conflict Error
Fio API documentation (Section 8.3) 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.
Development
Install using uv:
git clone git@github.com:honzajavorek/fiobank.git cd fiobank uv sync
Then run tests:
uv run pytest
License: ISC
© 2025 Honza Javorek <mail@honzajavorek.cz>
This work is licensed under the ISC license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fiobank-4.0.0.tar.gz
.
File metadata
- Download URL: fiobank-4.0.0.tar.gz
- Upload date:
- Size: 353.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
0f2c76f331b4c506dc54ba083db1e9e79d7a0f847698605478de385bfd509223
|
|
MD5 |
6ffeee8d45d370c054cf6cd6861e5e1b
|
|
BLAKE2b-256 |
90bb557b7c60d44f961a9f1393357af80af8137979b88ba619503fea2c793a9d
|
File details
Details for the file fiobank-4.0.0-py3-none-any.whl
.
File metadata
- Download URL: fiobank-4.0.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
309febe264bd6608181f689fba303027a468d56473b91db92a4899e43f7b7546
|
|
MD5 |
4c3ec571cd5b36b683251287525231b5
|
|
BLAKE2b-256 |
6308cd46584bed7e523af779789ad926fea799ce706bcdb6df725c6d9ee27574
|