Skip to main content

Fio Bank API in Python

Project description

PyPI version Build Status Test Coverage

Fio Bank API in Python.

Installation

$ pip install 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'
}

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.

License: ISC

© 2013 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-3.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

fiobank-3.1.0-py2.py3-none-any.whl (5.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: fiobank-3.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.8

File hashes

Hashes for fiobank-3.1.0.tar.gz
Algorithm Hash digest
SHA256 f232f7b30b696d2f57227ab65c737024a720807014342faee595ce8db451fe6d
MD5 257676f0f51531e32539798749eff7e3
BLAKE2b-256 4cd5271804cfdc87005ad1e81116a3bbdfb874bd1dc4e8f5b52286d85778fe9d

See more details on using hashes here.

File details

Details for the file fiobank-3.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: fiobank-3.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.8

File hashes

Hashes for fiobank-3.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 155ded544cc74737da275044fb887b8733cb42b0cce67f02c00ff889bf6a400b
MD5 a4fe0782a77734d517dcb79b1a2b11ac
BLAKE2b-256 ad4561938ddac54287b0dcbf80e7b64820ee940a8a5d6b14b1174634467eba1c

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