Parse statement transactions and summary
parse_statementExtract transaction rows and balances from bank statement text. Detects format (CAMT, MT940, CSV, OFX, QFX) via filename or explicit override.
Instructions
Parse an inline statement payload into transaction rows and a summary.
Use this to read the full transaction detail plus the statement
balances from a payload. When you only need the balances/totals use
``summarize_statement`` instead, and to merely confirm a payload parses
without returning any rows use ``validate_statement``.
Args:
content: The raw statement text.
filename: Original filename; its extension selects the format
when ``format`` is omitted.
format: Explicit format override.
limit: Optional cap on returned transaction rows.
Returns:
A dict with the resolved ``format``, ``columns``, full
``transaction_count``, the (possibly truncated) ``transactions``
as row dicts, and the statement ``summary``.
Raises:
ValueError: If the format is unsupported or cannot be detected.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Optional maximum number of transaction rows to return. The full 'transaction_count' is always reported even when the returned rows are truncated. When omitted, all rows are returned. | |
| format | No | Explicit format identifier that overrides detection from the filename. One of: 'camt' (CAMT.053), 'pain001', 'csv', 'ofx', 'qfx', 'mt940'. When omitted, the format is inferred from the filename extension. | |
| content | Yes | The raw statement text to parse, inline (not a file path). Accepts ISO 20022 CAMT.053 and pain.001 XML, SWIFT MT940, CSV exports, and OFX/QFX payloads. | |
| filename | No | Original filename of the payload; its extension (.xml, .csv, .ofx, .qfx, .mt940, .sta) selects the format when 'format' is omitted. Defaults to 'statement.xml'. | statement.xml |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||