Detect statement format
detect_formatIdentify the format of an unknown bank statement payload using content and filename hint, returning a format identifier for subsequent parsing.
Instructions
Detect which bank statement format an inline payload is.
Use this when you hold statement text but do not yet know its format,
to resolve the ``format`` identifier from the content plus filename
hint. Once the format is known, call ``parse_statement`` to read the
transactions instead of calling this again.
Args:
content: The raw statement text.
filename: Original filename; its extension is the primary hint.
Returns:
The detected format identifier.
Raises:
ValueError: If the format cannot be detected.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The raw statement text to inspect, inline (not a file path). Supported formats include ISO 20022 CAMT.053 and pain.001 XML, SWIFT MT940, CSV exports, and OFX/QFX. | |
| filename | No | Original filename of the payload; its extension is the primary detection hint. Recognised extensions: .xml, .csv, .ofx, .qfx, .mt940, .sta. Defaults to 'statement.xml'. | statement.xml |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |