Parse camt.053 statement file
parse_camt053Parse a camt.053 bank statement XML file from your local filesystem into structured data. Optionally validate against an XSD before parsing.
Instructions
Parse a camt.053 bank-statement XML file on disk into structured data.
Use this to read a bank's account statement (the reply that confirms
settlement) into a header + entry list. Reads ``xml_file_path`` from the
local filesystem. For the payment-status reply (accepted/rejected per
transaction) use ``parse_pain002`` instead; to validate a camt.053
string you already hold, this is not it — this tool needs a file path.
Wraps :func:`pain001.parse_camt053_statement`. When ``xsd_file_path``
is provided, the document is first validated against that XSD; on a
schema or parse error the tool returns ``{"error": ...}`` rather than
raising.
Args:
xml_file_path: Filesystem path to the camt.053 XML statement.
xsd_file_path: Optional path to a camt.053 XSD for upfront
validation.
Returns:
A compact dict with the statement header and entry list, or an
``{"error": ...}`` payload on failure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml_file_path | Yes | Local filesystem path to the camt.053 bank-statement XML file to parse. | |
| xsd_file_path | No | Optional local path to a camt.053 XSD; when given, the document is validated against it before parsing. Omit to skip schema validation. |