-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from honzajavorek/honzajavorek/facelift
Facelift
- Loading branch information
Showing
15 changed files
with
506 additions
and
194 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Copyright (c) 2024, Honza Javorek <[email protected]> | ||
Copyright (c) 2025, Honza Javorek <[email protected]> | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
fiobank | ||
======= | ||
|
||
|PyPI version| |Build Status| |Test Coverage| | ||
|
||
`Fio Bank API <http://www.fio.cz/bank-services/internetbanking-api>`__ | ||
`Fio Bank API <http://www.fio.cz/bank-services/internetbanking-api>`_ | ||
in Python. | ||
|
||
Installation | ||
------------ | ||
|
||
.. code:: sh | ||
From PyPI:: | ||
|
||
pip install fiobank | ||
|
||
$ 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 | ||
----- | ||
|
@@ -76,35 +78,28 @@ Listing the latest transactions: | |
Conflict Error | ||
-------------- | ||
|
||
`Fio API documentation <http://www.fio.cz/docs/cz/API_Bankovnictvi.pdf>`__ | ||
(Section 8.2) states that a single token should be used only once per | ||
`Fio API documentation <http://www.fio.cz/docs/cz/API_Bankovnictvi.pdf>`_ | ||
(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. | ||
|
||
Contributing | ||
------------ | ||
Development | ||
----------- | ||
|
||
.. code:: shell | ||
Install using `uv <https://docs.astral.sh/uv/>`_:: | ||
|
||
$ pip install -e .[tests] | ||
$ pytest | ||
git clone [email protected]:honzajavorek/fiobank.git | ||
cd fiobank | ||
uv sync | ||
|
||
Changelog | ||
--------- | ||
Then run tests:: | ||
|
||
See `GitHub Releases <https://github.com/honzajavorek/fiobank/releases>`_. | ||
uv run pytest | ||
|
||
License: ISC | ||
------------ | ||
|
||
© 2024 Honza Javorek [email protected] | ||
© 2025 Honza Javorek <[email protected]> | ||
|
||
This work is licensed under the `ISC | ||
license <https://en.wikipedia.org/wiki/ISC_license>`__. | ||
|
||
.. |PyPI version| image:: https://badge.fury.io/py/fiobank.svg | ||
:target: https://badge.fury.io/py/fiobank | ||
.. |Build Status| image:: https://github.com/honzajavorek/fiobank/actions/workflows/test.yml/badge.svg | ||
:target: https://github.com/honzajavorek/fiobank/actions/workflows/test.yml | ||
.. |Test Coverage| image:: https://coveralls.io/repos/github/honzajavorek/fiobank/badge.svg?branch=master | ||
:target: https://coveralls.io/github/honzajavorek/fiobank?branch=master | ||
license <https://en.wikipedia.org/wiki/ISC_license>`_. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[project] | ||
name = "fiobank" | ||
version = "4.0.0" | ||
description = "Fio Bank API in Python (unofficial)" | ||
readme = "README.rst" | ||
authors = [{name = "Honza Javorek", email = "[email protected]"}] | ||
license = {text = "ICS"} | ||
requires-python = "<4.0,>=3.9" | ||
dependencies = [ | ||
"requests<3.0.0,>=2.28.2", | ||
] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: ISC License (ISCL)", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Internet", | ||
] | ||
|
||
[project.urls] | ||
repository = "https://github.com/honzajavorek/fiobank" | ||
|
||
[dependency-groups] | ||
dev = [ | ||
"pytest<8.0.0,>=7.2.1", | ||
"responses<1.0.0,>=0.22.0", | ||
"mock<6.0.0,>=5.0.1", | ||
"ruff<1.0.0,>=0.8.4", | ||
"pytest-ruff<1.0.0,>=0.4.1", | ||
] | ||
|
||
[tool.pytest.ini_options] | ||
pythonpath = ["."] | ||
testpaths = "tests" | ||
norecursedirs = "env venv .git" | ||
addopts = "--ff --ruff --ruff-format" | ||
filterwarnings = ["ignore:Using float for money can cause inaccuracies:DeprecationWarning"] | ||
|
||
[tool.ruff.lint] | ||
extend-select = ["I"] | ||
|
||
[tool.ruff.lint.isort] | ||
combine-as-imports = true | ||
lines-after-imports = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,29 @@ | ||
from datetime import date, datetime | ||
|
||
import pytest | ||
|
||
from fiobank import coerce_date | ||
|
||
|
||
@pytest.mark.parametrize('test_input', [ | ||
date(2016, 8, 3), | ||
datetime(2016, 8, 3, 21, 3, 42), | ||
'2016-08-03T21:03:42', | ||
]) | ||
@pytest.mark.parametrize( | ||
"test_input", | ||
[ | ||
date(2016, 8, 3), | ||
datetime(2016, 8, 3, 21, 3, 42), | ||
"2016-08-03T21:03:42", | ||
], | ||
) | ||
def test_coerce_date(test_input): | ||
assert coerce_date(test_input) == date(2016, 8, 3) | ||
|
||
|
||
@pytest.mark.parametrize('test_input', [42, True]) | ||
@pytest.mark.parametrize("test_input", [42, True]) | ||
def test_coerce_date_invalid_type(test_input): | ||
with pytest.raises(TypeError): | ||
coerce_date(test_input) | ||
|
||
|
||
@pytest.mark.parametrize('test_input', ['21:03:42', '[email protected]']) | ||
@pytest.mark.parametrize("test_input", ["21:03:42", "[email protected]"]) | ||
def test_coerce_date_invalid_value(test_input): | ||
with pytest.raises(ValueError): | ||
coerce_date(test_input) |
Oops, something went wrong.