Developer Reference
API & SDK Reference
Complete programming interfaces, types, and error handling for Rust, Python, and CLI pipelines.
Bank Statement Parser exposes deterministic, zero-allocation interfaces across both native Rust and PyO3-powered Python bindings. Every function executes strictly in-process with zero network telemetry, complete memory safety, and mathematical balance verification.
Rust Core Library Interface (lib.rs)
Integrate the native Rust crate directly into your backend services for maximum CPU throughput, sub-millisecond document parsing, and zero heap duplication:
Core data types provided by the native crate:
| Type / Symbol | Signature | Description |
|---|---|---|
Parser | struct Parser | Thread-safe parser engine supporting zero-copy byte slice and file ingestion. |
ParserBuilder | struct ParserBuilder | Configures parallel threads, balance invariants, and dialect heuristics. |
Statement | struct Statement | Normalized document model containing account ID, balances, currency, and transactions. |
Transaction | struct Transaction | Individual ledger item with booking date, value date, signed amount, and narrative. |
StatementFormat | enum StatementFormat | Output target variants: Json, Csv, Ofx, Qif, and Camt053. |
Python SDK Interface (PyO3)
Pre-compiled binary wheels for Linux, macOS, and Windows provide native Rust speed directly inside Python data science, pandas, and web application workflows:
Core parsers and analytical tools exported by the module:
| Symbol | Type / Signature | Purpose & Description |
|---|---|---|
BankStatementParser | Class | Primary document engine for PDF layout extraction, OCR fallback, and multi-format routing. |
Bai2Parser | Class | Dedicated state machine parser for BAI2 corporate cash management files. |
CamtParser | Class | High-speed XML parser for ISO 20022 CAMT.052, CAMT.053, and CAMT.054 statements. |
Pain001Parser | Class | Parser for ISO 20022 PAIN.001 customer credit transfer payment instructions. |
Mt940Parser / Mt942Parser | Class | SWIFT MT940 end-of-day and MT942 intraday tag-based message parsers. |
ParquetStreamWriter | ContextManager | Streams batches of transactions directly to Apache Parquet with Snappy/Zstd compression. |
reconcile_payments_and_statements | Function | Two-way automated reconciliation matching payment orders against statement postings. |
inspect_pdf_forensics | Function | Audits PDF statements for font discrepancies, metadata modifications, and tampering findings. |
analyze_statement_transactions | Function | Computes cash flow summaries, average daily balances, NSF fees, and recurring cadences. |
Deterministic Error Handling & Diagnostics
All processing pipelines isolate corrupt documents, unsupported regional dialects, and balance arithmetic discrepancies into typed error exceptions without panics or unhandled crashes:
Zero-Telemetry Execution Guarantees
Bank Statement Parser makes zero outbound network calls, transmits no analytical telemetry, and requires no external SaaS API keys. Sensitive financial documents and banking statements remain strictly confined within your own compute environment.