fio-banka


Namefio-banka JSON
Version 3.0.0 PyPI version JSON
download
home_page
SummaryFio Banka API
upload_time2024-02-16 08:04:16
maintainer
docs_urlNone
author
requires_python>=3.11
licenseMIT License Copyright (c) 2023 Petr Beranek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords finance fio bank api czech
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Fio Banka API

[![image](https://img.shields.io/pypi/v/fio-banka)](https://pypi.org/project/fio-banka/)
[![image](https://img.shields.io/pypi/l/fio-banka)](https://pypi.org/project/fio-banka/)
[![image](https://img.shields.io/pypi/pyversions/fio-banka)](https://pypi.org/project/fio-banka/)
[![image](https://github.com/peberanek/fio-banka/actions/workflows/tests.yml/badge.svg)](https://github.com/peberanek/fio-banka/actions/workflows/tests.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/peberanek/fio-banka/main.svg)](https://results.pre-commit.ci/latest/github/peberanek/fio-banka/main)

Rework of Honza Javorek's [fiobank](https://github.com/honzajavorek/fiobank), with the following upgrades:

* Parse both account info and transactions in 1 request. This is particularly useful as Fio banka allows only 1 request per 30 seconds.
* Known error states are covered by exceptions for fine-grade error handling.
* Fetch data in all supported formats (including PDF).
* New design allows to support other end points than account.
* Safer data types: money as [`decimal.Decimal` instead of `float`](https://docs.python.org/3/tutorial/floatingpoint.html), data stored as `typing.NamedTuple` instead of `dict`.

> [!NOTE]
> Merchant transaction report and order upload are not implemented. Feel free to send a PR.

## Quick example
```python
>>> import fio_banka, datetime
>>> account = fio_banka.Account("my-API-token")
>>> transaction_report = account.fetch_transaction_report_for_period(
...     datetime.date(2023, 1, 1),
...     datetime.date(2023, 1, 2),
...     fio_banka.TransactionReportFmt.JSON
... )
>>> account.parse_account_info(transaction_report)  # JSON only
AccountInfo(
    account_id='2000000000',
    bank_id='2010',
    currency='CZK',
    iban='CZ1000000000002000000000',
    ...
)
>>> next(iter(account.parse_transactions(transaction_report)))  # JSON only
Transaction(
    transaction_id='10000000000',
    date=datetime.date(2023, 1, 1),
    amount=Decimal('2000.0'),
    currency='CZK',
    account_id=None,
    ...
```

## Documentation

For full description see the module [docstring](https://github.com/peberanek/fio-banka/blob/main/fio_banka.py).

API documentation by Fio banka:

* [Specification](https://www.fio.cz/docs/cz/API_Bankovnictvi.pdf) (Czech only)
* [XSD Schema](https://www.fio.cz/xsd/IBSchema.xsd)


## Installation

```
pip install fio-banka
```

## Contributing

Set up development environment via [Pipenv](https://pipenv.pypa.io/en/latest/):

```bash
pipenv sync --dev
pipenv run pre-commit install
```

Run tests:
```bash
pytest
```

Use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).

I highly recommend to follow [Test-Driven Development (revisited)](https://www.youtube.com/watch?v=IN9lftH0cJc). Actually, all existing tests follow it.

## License

This project is licensed under the terms of the MIT license.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "fio-banka",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "",
    "keywords": "finance,fio,bank,api,czech",
    "author": "",
    "author_email": "Petr Beranek <petrberanek.mail@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/83/35/d11645c224655f8710d2429cb39729789c1a008336c0c234f2ab84c93cd0/fio_banka-3.0.0.tar.gz",
    "platform": null,
    "description": "# Fio Banka API\n\n[![image](https://img.shields.io/pypi/v/fio-banka)](https://pypi.org/project/fio-banka/)\n[![image](https://img.shields.io/pypi/l/fio-banka)](https://pypi.org/project/fio-banka/)\n[![image](https://img.shields.io/pypi/pyversions/fio-banka)](https://pypi.org/project/fio-banka/)\n[![image](https://github.com/peberanek/fio-banka/actions/workflows/tests.yml/badge.svg)](https://github.com/peberanek/fio-banka/actions/workflows/tests.yml)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/peberanek/fio-banka/main.svg)](https://results.pre-commit.ci/latest/github/peberanek/fio-banka/main)\n\nRework of Honza Javorek's [fiobank](https://github.com/honzajavorek/fiobank), with the following upgrades:\n\n* Parse both account info and transactions in 1 request. This is particularly useful as Fio banka allows only 1 request per 30 seconds.\n* Known error states are covered by exceptions for fine-grade error handling.\n* Fetch data in all supported formats (including PDF).\n* New design allows to support other end points than account.\n* Safer data types: money as [`decimal.Decimal` instead of `float`](https://docs.python.org/3/tutorial/floatingpoint.html), data stored as `typing.NamedTuple` instead of `dict`.\n\n> [!NOTE]\n> Merchant transaction report and order upload are not implemented. Feel free to send a PR.\n\n## Quick example\n```python\n>>> import fio_banka, datetime\n>>> account = fio_banka.Account(\"my-API-token\")\n>>> transaction_report = account.fetch_transaction_report_for_period(\n...     datetime.date(2023, 1, 1),\n...     datetime.date(2023, 1, 2),\n...     fio_banka.TransactionReportFmt.JSON\n... )\n>>> account.parse_account_info(transaction_report)  # JSON only\nAccountInfo(\n    account_id='2000000000',\n    bank_id='2010',\n    currency='CZK',\n    iban='CZ1000000000002000000000',\n    ...\n)\n>>> next(iter(account.parse_transactions(transaction_report)))  # JSON only\nTransaction(\n    transaction_id='10000000000',\n    date=datetime.date(2023, 1, 1),\n    amount=Decimal('2000.0'),\n    currency='CZK',\n    account_id=None,\n    ...\n```\n\n## Documentation\n\nFor full description see the module [docstring](https://github.com/peberanek/fio-banka/blob/main/fio_banka.py).\n\nAPI documentation by Fio banka:\n\n* [Specification](https://www.fio.cz/docs/cz/API_Bankovnictvi.pdf) (Czech only)\n* [XSD Schema](https://www.fio.cz/xsd/IBSchema.xsd)\n\n\n## Installation\n\n```\npip install fio-banka\n```\n\n## Contributing\n\nSet up development environment via [Pipenv](https://pipenv.pypa.io/en/latest/):\n\n```bash\npipenv sync --dev\npipenv run pre-commit install\n```\n\nRun tests:\n```bash\npytest\n```\n\nUse [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).\n\nI highly recommend to follow [Test-Driven Development (revisited)](https://www.youtube.com/watch?v=IN9lftH0cJc). Actually, all existing tests follow it.\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Petr Beranek  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Fio Banka API",
    "version": "3.0.0",
    "project_urls": {
        "Homepage": "https://github.com/peberanek/fio-banka"
    },
    "split_keywords": [
        "finance",
        "fio",
        "bank",
        "api",
        "czech"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c0a7fc7c0d0224f0e14301915d1d2a4f75da11156ece9950544035a817726048",
                "md5": "0894056b5c68279712dbbc578fe5121b",
                "sha256": "94695b93a350547efe5e0d33ceea72de35290b668f88a8900c53c1b94d06fc54"
            },
            "downloads": -1,
            "filename": "fio_banka-3.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0894056b5c68279712dbbc578fe5121b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 7704,
            "upload_time": "2024-02-16T08:04:15",
            "upload_time_iso_8601": "2024-02-16T08:04:15.053023Z",
            "url": "https://files.pythonhosted.org/packages/c0/a7/fc7c0d0224f0e14301915d1d2a4f75da11156ece9950544035a817726048/fio_banka-3.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8335d11645c224655f8710d2429cb39729789c1a008336c0c234f2ab84c93cd0",
                "md5": "f6f868764301d3d5c6c18a88526d07c8",
                "sha256": "30147375032997ebfbe54e1ad1c50ce268afeb7299dc0e57f6dbbed34d51ddd3"
            },
            "downloads": -1,
            "filename": "fio_banka-3.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f6f868764301d3d5c6c18a88526d07c8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 27883,
            "upload_time": "2024-02-16T08:04:16",
            "upload_time_iso_8601": "2024-02-16T08:04:16.134652Z",
            "url": "https://files.pythonhosted.org/packages/83/35/d11645c224655f8710d2429cb39729789c1a008336c0c234f2ab84c93cd0/fio_banka-3.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-16 08:04:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "peberanek",
    "github_project": "fio-banka",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fio-banka"
}
        
Elapsed time: 0.29428s