bankstatementparser documentation

The canonical, versioned API reference for each package lives in its own GitHub README — this hub orients you across the suite, explains the shared concepts, and points you to the right README when you need method signatures and options.

Read this page top to bottom for the mental model: the formats it reads, the single Transaction model everything collapses into, the two pipelines that do the work, the privacy defaults, and how to export. Then follow the links to the package you actually need.

The packages

Six Apache-2.0 packages, each documented in its own README on GitHub and published to PyPI. Start with the core parser and add the rest as you need them.

bankstatementparser

Core parser

Reads the structured formats and PDFs into the unified Transaction model.

GitHub · PyPI

bankstatementparser-loader-bai2

BAI2 loader

Loads BAI2 cash-management and lockbox files into the core model.

GitHub · PyPI

bankstatementparser-loader-mt942

MT942 loader

Parses SWIFT MT942 interim transaction reports into the same model.

GitHub · PyPI

bankstatementparser-writer-xlsx

XLSX writer

Writes parsed transactions to formatted .xlsx workbooks.

GitHub · PyPI

bankstatementparser-lsp

LSP server

A Language Server that brings editor tooling to statement files and mappings.

GitHub · PyPI

bankstatementparser-mcp

MCP server

Exposes the parser as Model Context Protocol tools for agents over stdio.

GitHub · PyPI

Core concepts

A handful of ideas explain the whole suite: the formats it reads, the model they all become, the two pipelines that produce that model, the privacy posture, and how you get data back out.

Formats

The parser reads CAMT (ISO 20022), PAIN.001, SWIFT MT940 and MT942, BAI2, OFX/QFX, CSV, and PDF — both digital and scanned. Each has its own dialect and quirks, but all of them are normalised into the same output. For a format-by-format breakdown of origins and parsing behaviour, see the formats reference.

The Transaction model

Whatever the source format, every statement line collapses into one typed Transaction record. Generically, a transaction carries a booking date, a value date, an amount, a currency, a counterparty, a reference, and a type (for example credit or debit). Because the shape is stable, downstream reconciliation, ledgers and exports are written once rather than per format. Field names and exact types are documented in the core package README.

The two pipelines

Structured formats take the deterministic pipeline: explicit, rule-based parsing that is repeatable, testable and auditable line by line. PDFs take the second pipeline — a local LLM extracts transactions from the text, and a local vision model handles scanned pages as a fallback. The structured path never invokes a model.

Privacy

Processing is on-device by default. Deterministic parsing is entirely local, and the PDF pipeline uses local models (Ollama by default). Your statements only reach an external provider if you explicitly opt in and configure one. See the privacy statement for details.

Exporting

Once you have a list of transactions, the XLSX writer turns them into a clean, formatted .xlsx workbook for analysts and auditors. It is a separate package so the core parser stays dependency-light; install it alongside the core when you need spreadsheet output.

Loaders & integrations

The suite extends the core parser with focused loaders and two servers that plug into editors and agents.

BAI2 loader

Handles BAI2 cash-management and lockbox files, feeding them into the core Transaction model so US bank output joins the same pipeline as everything else. GitHub

MT942 loader

Parses SWIFT MT942 interim transaction reports — the intraday sibling of MT940 — into the shared model. GitHub

LSP server

A Language Server Protocol implementation that brings editor tooling — over statement files and mappings — to any LSP-capable editor. GitHub

MCP server

Exposes the parser as Model Context Protocol tools over stdio, so agents such as Claude, Cursor and Zed can read statements through a defined tool interface. GitHub

Support & contributing

Found a bug, or want to add a format or feature? Open an issue or a pull request on GitHub — contributions across the suite are welcome. For anything else, get in touch through the contact page.

Where to next

Install the suite and parse your first statement, or dig into the format-by-format reference.