Skip to main content

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.

token.png

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

Releasing

Release flow is automated by GitHub Actions in .github/workflows/release.yml.

  1. Bump the version in pyproject.toml using uv:

    uv version --bump patch  # or minor / major
  2. Review and commit the version change:

    git commit -am "release vX.Y.Z"
  3. Create and push a git tag for that version:

    git tag vX.Y.Z
    git push origin HEAD --tags

When the tag appears on GitHub, the release workflow builds and smoke-tests the package, then publishes it to PyPI automatically (for the honzajavorek/fiobank repository only).

The changelog is maintained in GitHub Releases.

License: ISC

© 2025 Honza Javorek <mail@honzajavorek.cz>

This work is licensed under the ISC license.

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

fiobank-4.1.1.tar.gz (378.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fiobank-4.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file fiobank-4.1.1.tar.gz.

File metadata

  • Download URL: fiobank-4.1.1.tar.gz
  • Upload date:
  • Size: 378.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fiobank-4.1.1.tar.gz
Algorithm Hash digest
SHA256 bff4ea5299558bf5fac4e2c83d998914ebb8b53dd515ca8cd32d5e02446fb65e
MD5 3556a4833be9e9e69fef60fa0a7dd729
BLAKE2b-256 1e0847790aab4c6b19cb7674c5992eee4eda5252dcd9afb1264917a2fa6e4c72

See more details on using hashes here.

File details

Details for the file fiobank-4.1.1-py3-none-any.whl.

File metadata

  • Download URL: fiobank-4.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fiobank-4.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2de62834f1779cfd44bfb9319e7624f9751309c01eca0e26ecf3c2e23e9b2760
MD5 17bfd77ceb2505c52c819a1da27bf9f5
BLAKE2b-256 dcbeb64e8c7c2cbe430f711a3505393d3bdf3a7a951c2529a8ba2ce7078e2a3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page