Skip to main content

ua-banktools

A collection of Python tools and APIs for interacting with Ukrainian banks

Banks currently supported

  • PrivatBank (legal entities only)
  • monobank (public and personal)
  • National Bank of Ukraine (public exchange rates)

Features

  • Object-oriented as much as possible, with IBANs validated by schwifty, timestamps automatically parsed into datetime objects, and known categorical values parsed into enums.
  • Multiple banks in one package.

Monobank Open API

from datetime import datetime

from ua_banktools.banks import MonobankPersonalClient, MonobankPublicClient

public_client = MonobankPublicClient()
client = MonobankPersonalClient("your-token")
public_client.get_currency_rates()
public_client.get_bank_sync()
client.get_client_info()
client.set_webhook("https://example.com/monobank-webhook")
client.get_statement("account-id", datetime(2026, 1, 1))

The default base URL is https://api.monobank.ua/. It can be overridden for an egress gateway; include any route prefix required by the gateway:

client = MonobankPersonalClient(
    "your-token",
    base_url="https://mono-egress.example.com/mono/",
)

Tests

Run the mocked Monobank tests with just test mono, or all available tests with just test. An explicitly opted-in, read-only smoke test is also available:

# .env (do not commit this file!)
MONO_TOKEN=your-personal-token

just test mono-live

The live test makes one client-info request and one statement request for the most recent hour. It is skipped by normal test runs and never changes webhook configuration.

PrivatBank Autoclient API

from datetime import date
from decimal import Decimal

from schwifty import IBAN

from ua_banktools.banks import ExchangeRateType, PBCorporateClient, PBPublicClient

client = PBCorporateClient("your-token")
public_client = PBPublicClient()
account = IBAN("UA943052990000026100050001037")

cash_rates = public_client.get_exchange_rates()
non_cash_rates = public_client.get_exchange_rates(ExchangeRateType.NON_CASH)
historical_rates = public_client.get_historical_exchange_rates(date(2026, 7, 1))
balances = client.get_balance(account, date(2026, 7, 1), limit=100)
transactions = client.get_transactions(
    account,
    date(2026, 7, 1),
    date(2026, 7, 10),
)
payment = client.create_payment(
    payer_acct=account,
    recipient_acct=IBAN("UA323052990000026000000000000"),
    recipient_nceo="14360570",
    payee_name="Counterparty",
    amount=Decimal("1.20"),
    designation="Payment purpose",
    document_number="42",
)

# Delete a created payment while it is still eligible for deletion.
client.delete_payment(payment.payment_ref)

Pass None as the statement account to request all active accounts. If exist_next_page is true, pass the response's next_page_id back as follow_id. The optional client_id constructor argument remains available for legacy integrations.

Run the mocked PrivatBank tests with just test pb.

National Bank of Ukraine Open Data API

from datetime import date

from ua_banktools.banks import NBUPublicClient, NBUSortOrder

client = NBUPublicClient()

current_rates = client.get_exchange_rates()
eur_rate = client.get_exchange_rate("EUR", date(2026, 7, 1))
usd_history = client.get_exchange_rate_history(
    "USD",
    date(2026, 7, 1),
    date(2026, 7, 10),
    order=NBUSortOrder.DESC,
)

Currency and investment-metal codes are case-insensitive and normalized to uppercase. Rates are parsed as Decimal values and NBU dates as date values. The API is public and does not require authentication. Run its mocked tests with just test nbu.

Metadata

Release files for ua-banktools 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ua-banktools 0.2.0
File Size Uploaded Provenance Actions
ua_banktools-0.2.0.tar.gz 79.4 kB Without provenance Details for ua_banktools-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ua-banktools 0.2.0
File Interpreter ABI Platform Actions
ua_banktools-0.2.0-py3-none-any.whl Python 3 none any Details for ua_banktools-0.2.0-py3-none-any.whl

Total release size: 95.7 kB

Release files / ua_banktools-0.2.0.tar.gz

Download URL ua_banktools-0.2.0.tar.gz
Size 79.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0e2f1a27ea317dacebcd488a26d1fc151c7163b7201392624fdeebe8c3aa8dff
BLAKE2b-256 checksum
How to use checksums
eb65cab842fd2c8a23152bdc81bec20b2771f45c4588f5aeb91a8e0a8a052d0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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}

Release files / ua_banktools-0.2.0-py3-none-any.whl

Download URL ua_banktools-0.2.0-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c9c7f3b5d2e76f951f3679156684659259c67c5b982c935164200fdc93a1e32
BLAKE2b-256 checksum
How to use checksums
b23e8bfdb7b8add0ef8cb151442623e96984100d1683cfadf7bb666c158799b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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}

Security for ua-banktools 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page