Generate pain XML from a CSV file
generate_message_from_fileGenerate validated ISO 20022 pain XML messages from a CSV file on the local disk. Reads one payment record per row and outputs the corresponding XML.
Instructions
Generate validated pain XML from a CSV file on the local disk.
Use this when the records live in a CSV file rather than in memory; it
reads ``data_file_path`` from the local filesystem, then delegates to
``generate_message``. If you already have the records as dicts, call
``generate_message`` directly. Only CSV is supported today (JSON / JSONL
/ SQLite / Parquet are planned for a follow-up release).
Loads ``data_file_path`` via :func:`pain001.csv.load_csv_data.load_csv_data`
so the same path-safety guards apply as in the core library.
Args:
message_type: A supported ISO 20022 pain message type.
data_file_path: Path to a CSV file with one record per row.
Returns:
The validated XML, or a JSON-encoded ``{"error": ...}`` payload.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message_type | Yes | A supported ISO 20022 pain message type. Must be exactly one of: 'pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05', 'pain.001.001.06', 'pain.001.001.07', 'pain.001.001.08', 'pain.001.001.09', 'pain.001.001.10', 'pain.001.001.11', 'pain.001.001.12', 'pain.008.001.02' (see list_message_types). | |
| data_file_path | Yes | Local filesystem path to a CSV file with one payment record per row and a header matching the template columns (see inspect_template). Only CSV is supported today. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |