pain001.core package#
Submodules#
pain001.core.core module#
End-to-end orchestration of ISO 20022 payment file generation.
- pain001.core.core.process_files(xml_message_type: str, xml_template_file_path: str, xsd_schema_file_path: str, data_file_path: str | list[dict[str, Any]] | dict[str, Any], output_path: str | None = None) str[source]#
Generate an ISO 20022 payment message from various data sources.
- Parameters:
xml_message_type – XML message type (e.g., ‘pain.001.001.03’).
xml_template_file_path – Path to the XML template file.
xsd_schema_file_path – Path to the XSD schema file.
data_file_path – File path (CSV/DB/JSON/Parquet) or Python data (list/dict).
output_path – Explicit path for the generated XML file. When omitted, the file is written next to the template (deprecated; requires the template to live under the current working directory).
- Returns:
The path the generated XML file was written to.
- Raises:
XMLGenerationError – If the message type is not supported or the XML file could not be written.
Exception – Any error raised while validating inputs, loading data, or generating XML (e.g. FileNotFoundError for missing files, PaymentValidationError for bad amounts) is logged and re-raised unchanged.
- pain001.core.core.process_files_streaming(xml_message_type: str, xml_template_file_path: str, xsd_schema_file_path: str, data_file_path: str, chunk_size: int = 1000, output_dir: str | None = None) list[str][source]#
Generate multiple XML files from streamed input chunks.
- Parameters:
xml_message_type – XML message type (e.g., ‘pain.001.001.03’).
xml_template_file_path – Path to the XML template file.
xsd_schema_file_path – Path to the XSD schema file.
data_file_path – Path to the payment data file.
chunk_size – Rows per chunk; each chunk becomes one XML file.
output_dir – Directory to write chunked XML files to. When omitted, files are written next to the data file.
- Returns:
Paths of the generated chunk XML files, in chunk order.
Module contents#
Core processing package for pain001.