fioapi
Async Rust client for the Fio banka REST API. It mirrors the official API (see API_Bankovnictvi.pdf) and the bundled Python reference (fio_banka.py), exposing typed models, error mapping, and helpers for parsing JSON statements.
Features
- Async reqwest client with explicit format enums for transaction reports and account statements.
- Typed models for account info and transactions with serde column mapping.
- Error types that map HTTP status codes to domain errors.
- Helpers to parse JSON payloads into domain types without hitting the network.
Installation
[]
= { = "." }
Requires Rust 1.74+ and Tokio runtime.
Usage
use ;
use env;
async
Examples
cargo run --example fetch_transactionsreadsFIO_API_TOKENfrom environment or.envand prints transactions from the last 30 days.cargo run --example set_last_unsuccessful_download_date [YYYY-MM-DD]sets the last unsuccessful download date (defaults to yesterday when no date is provided).
Development
- Format and lint:
cargo fmt,cargo clippy --all-targets --all-features - Tests:
cargo test
Keep secrets (API tokens) out of VCS; pass them via env vars or .env. Default base URL is https://fioapi.fio.cz/v1/rest; override with Client::with_base_url for testing.
License
MIT