Use Cases

Real-World Applications

Bank Statement Parser handles real-world financial workflows: PDF bank statement ingestion, MT940-to-CAMT migration, automated reconciliation with balance verification, compliance pipelines, plaintext-accounting export, REST API deployments, bulk scanning, and multi-bank consolidation.

PDF Bank Statement Ingestion

Result: Parse digital and scanned PDF bank statements with automatic balance verification — no cloud APIs, no data leaves your machine.

The hybrid PDF pipeline routes each PDF through the optimal extraction path and verifies every result.

from bankstatementparser.hybrid import smart_ingest

result = smart_ingest("statement.pdf")
print(result.source_method)         # "deterministic" | "llm" | "vision"
print(result.verification.status)   # VERIFIED | DISCREPANCY | FAILED

# Review discrepancies interactively
# bankstatementparser --type review --input result.json

Bulk Statement Processing

Result: Scan entire folder trees (hundreds of PDFs, XMLs, CSVs) with automatic cross-file deduplication in a single call.

from bankstatementparser.hybrid import scan_and_ingest

batch = scan_and_ingest("statements/2026/", pattern="**/*.pdf")
print(f"Files: {len(batch.results)}, Unique txns: {batch.unique_count}")

Treasury: MT940 to CAMT.053 Migration

Result: A single API call handles both MT940 and CAMT.053 during the SWIFT migration window (November 2025–November 2028), eliminating the need for separate parsing pipelines.

Treasury teams worldwide are migrating from MT940 to CAMT.053 ahead of the November 2027 SWIFT deadline. Bank Statement Parser handles both formats with a single API, making the transition seamless.

from bankstatementparser import create_parser, detect_statement_format

# Process both MT940 and CAMT.053 with the same code
for file in daily_statement_files:
    fmt = detect_statement_format(file)
    parser = create_parser(file, fmt)
    df = parser.parse()
    load_to_treasury_system(df)

Automated Reconciliation with Balance Verification

Result: Format-agnostic DataFrames with Golden Rule verification and deduplication catch errors and duplicates before they reach your ledger.

Parse bank statements, verify balances, and match against internal records automatically.

from bankstatementparser import CamtParser, Deduplicator
from bankstatementparser.hybrid import verify_balance_multi_currency

parser = CamtParser("bank_statement.xml")
bank_txns = parser.parse()

# Verify balances per currency
verification = verify_balance_multi_currency(bank_txns)
for ccy, result in verification.items():
    assert result.status == "VERIFIED", f"{ccy} balance mismatch!"

# Deduplicate before reconciliation
dedup = Deduplicator()
result = dedup.deduplicate(dedup.from_dataframe(bank_txns))
clean_txns = result.unique_transactions

# Match against internal records
unmatched = reconcile(clean_txns, internal_ledger)

Plaintext Accounting (hledger / beancount)

Result: Automatically ingest PDF bank statements and export categorised transactions to hledger or beancount journal format.

from bankstatementparser.hybrid import smart_ingest
from bankstatementparser.enrichment import Categorizer
from bankstatementparser.export import to_hledger

result = smart_ingest("statement.pdf")
categorizer = Categorizer()
enriched = categorizer.categorize_batch(result.transactions)
journal = to_hledger(enriched, account="Assets:Bank:Checking")

REST API Deployment

Result: Deploy Bank Statement Parser as a microservice that accepts statement files via HTTP and returns structured JSON.

# Start the API server
bankstatementparser-api --port 8000
# Ingest a statement
curl -X POST http://localhost:8000/ingest \
  -F "file=@statement.pdf"

Compliance and Audit Pipelines

Result: Deterministic output, automatic PII redaction, and Golden Rule verification produce audit-ready logs that satisfy regulatory reproducibility requirements.

from bankstatementparser import CamtParser

parser = CamtParser("statement.xml")

# Stream with PII redacted for audit logs
for txn in parser.parse_streaming(redact_pii=True):
    audit_log.write(txn)

# Export full data for secure internal processing
parser.export_csv("archive/statement.csv")

SFTP-to-DataFrame Workflows

Result: Parse directly from bytes with zero disk I/O, fitting natively into SFTP and API-driven bank connectivity workflows.

from bankstatementparser import CamtParser

xml_bytes = sftp_client.read("daily_statement.xml")
parser = CamtParser.from_bytes(xml_bytes, source_name="daily.xml")
df = parser.parse()

Multi-Bank Consolidation

Result: Parallel parsing across HSBC (CAMT), Barclays (MT940), Revolut (CSV), Wise (OFX), and Chase (PDF) produces a single normalised dataset.

from bankstatementparser import parse_files_parallel

results = parse_files_parallel([
    "hsbc/camt053.xml",
    "barclays/mt940.sta",
    "revolut/transactions.csv",
    "wise/statement.ofx",
])

all_transactions = pd.concat([r.transactions for r in results if r.status == "success"])

Batch Processing with ZIP Archives

Result: Built-in ZIP bomb protection (100:1 ratio limit, 10 MB entry cap, encrypted entry rejection) lets you process monthly statement archives safely.

from bankstatementparser import iter_secure_xml_entries, CamtParser

for entry in iter_secure_xml_entries("monthly_statements.zip"):
    parser = CamtParser.from_bytes(entry.xml_bytes, source_name=entry.source_name)
    df = parser.parse()
    save_to_warehouse(entry.source_name, df)

Compare with alternatives ❯ | Plan your ISO 20022 migration ❯ | Get started ❯