Parse statement transactions and summary
parse_statementParse raw bank statement text (XML, CSV, MT940, OFX/QFX) into transaction rows and a summary, detecting format from 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. Must be exactly one of: 'camt', 'csv', 'mt940', 'ofx', 'pain001', 'qfx' (see list_supported_formats). 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 | |||