Repository navigation
Releases
Releases · shpigunov/ua_banktools
0.4.0
The first release built and published entirely by CI, with signed provenance on PyPI. It also brings the bank clients up to date with the current Monobank, PrivatBank and NBU APIs.
⚠️ Compatibility
- Python 3.11 or newer is now required. Python 3.10 reached end of life in October 2026. On 3.10, pip and uv will keep installing 0.3.0 automatically.
MonobankManagedClient.tinis nowIPN | str(it wasint). A valid tax number is parsed into anIPN. Anything else, such as the passport details used by FOPs registered without a tax number, stays a string instead of failing the wholeget_client_info()response. As anint, a tax number starting with0lost its leading zero.IPNnow compares by value and is hashable.IPN("…") == "…"works, and IPNs can go in sets or be dict keys. It never compares equal to anint, since that would drop leading zeros.IPNValidationErrornow subclassesValueError, so pydantic reports an invalid IPN as a regularValidationError. Existingexcept IPNValidationErrorblocks are unaffected.
Fixes
- Monobank:
MonobankPublicClient.get_currency_rates()works again. Monobank still quotes currencies that ISO 4217 has withdrawn: BGN (975, euro since 2026), HRK (191) and SLL (694). One such row made the whole call fail. Those rows are now skipped. They are not converted to the euro, because a lev or kuna isn't worth one euro. Any other malformed row still raises. - Monobank: rate-limit errors from the public endpoints come back as
MonobankErrorResponse. Those endpoints reply{"errCode": "TMR", "errText": …}instead of the documentederrorDescription. That used to raiseBankTransportError. A newerror_codefield carries"TMR". - PrivatBank: transactions now include
STRUCT_CATEGORY, the tax-notice field of a structured tax payment. It was being silently dropped.
Dependencies
- schwifty no longer has an upper bound (
>=2026.1.0). schwifty updates its bank registry roughly monthly, and the old<=2026.7.1cap kept you on outdated bank data. The full test suite passes on Python 3.11 with the lowest versions allowed (pydantic 2.1, schwifty 2026.1.0, httpx 0.28.1).
Supply chain
- Published through PyPI Trusted Publishing, with PEP 740 attestations. The PyPI page now shows which repository, workflow and commit built each file. To verify a download:
Releases before 0.4.0 were uploaded with an API token and have no attestations.
uvx pypi-attestations verify pypi \ --repository https://github.com/shpigunov/ua_banktools \ 'pypi:ua_banktools-0.4.0-py3-none-any.whl' - Dependencies are audited on every change and weekly (
uv auditagainst OSV), and the GitHub Actions workflows are audited with zizmor. - Report vulnerabilities privately: see SECURITY.md.
- Package metadata now declares the license (MIT) and the project URLs, so PyPI can show them as verified.
Full changelog: 0.3.0...0.4.0
0.3.0
ua-banktools 0.3.0
This release improves transport safety, model serialization, and statement retrieval across the supported Ukrainian bank APIs.
Highlights
- Added optional
httpx.Clientinjection to every bank client. - Added bounded default timeouts: 30 seconds overall and 10 seconds for connection establishment.
- Credentials are now attached per request, allowing one session to be shared safely between clients.
- Added
BankTransportErrorfor gateway, proxy, and other HTTP errors that do not match a bank’s documented error schema. - Made response models JSON-safe, including
CurrencyandIBANfields.
Complete statement retrieval
- Added
MonobankPersonalClient.get_full_statement(), which divides long date ranges into Monobank-compatible windows and combines the results. - Added
PBCorporateClient.get_all_transactions()andget_all_balances()to follow PrivatBank pagination automatically. - Added safeguards against repeated or malformed page identifiers and unexpectedly large page counts.
- Partial results are discarded when a later request fails, preventing incomplete statements from being mistaken for complete ones.
Additional improvements
- Improved NBU currency normalization.
- Exported
BankTransportErrorandDEFAULT_TIMEOUTfromua_banktools.banks. - Added
tystatic type checking and a generated ISO-4217 type stub. - Expanded tests for transport errors, session injection, serialization, pagination, and statement windowing.
Upgrade note
Clients no longer use an unlimited timeout by default. Applications requiring a larger timeout—such as those using a throttling or pacing proxy—should inject a configured session:
import httpx
from ua_banktools.banks import MonobankPersonalClient
session = httpx.Client(timeout=httpx.Timeout(90.0))
client = MonobankPersonalClient("your-token", session=session)