pain001.templates package#

ISO 20022 payment initiation templates for pain001.

Submodules#

pain001.templates.guardrails module#

Guardrails that detect template/schema drift.

exception pain001.templates.guardrails.SchemaGuardrailError[source]#

Bases: ValueError

Raised when template metadata or namespaces drift.

pain001.templates.guardrails.validate_registry(registry: ~pain001.templates.registry.TemplateRegistry = <pain001.templates.registry.TemplateRegistry object>) → list[str][source]#

Validate every registered template and return validated IDs.

pain001.templates.guardrails.validate_template_bundle(metadata: TemplateMetadata) → None[source]#

Validate one template bundle for existence and drift.

pain001.templates.registry module#

Automatic discovery and metadata registry for bundled templates.

class pain001.templates.registry.TemplateMetadata(message_type: str, message_category: str, template_path: Path, xsd_path: Path, example_data_path: Path | None, example_xml_path: Path | None, supported_input_formats: list[str], iso_version: str, deprecated: bool = False)[source]#

Bases: object

Describes a discovered ISO 20022 template bundle.

deprecated: bool = False#
example_data_path: Path | None#
example_xml_path: Path | None#
iso_version: str#
message_category: str#
message_type: str#
supported_input_formats: list[str]#
template_path: Path#
xsd_path: Path#
class pain001.templates.registry.TemplateRegistry(templates_dir: Path = PosixPath('/home/runner/work/pain001/pain001/pain001/templates'))[source]#

Bases: object

Discover and query supported template bundles.

get_template(message_type: str) → TemplateMetadata[source]#

Return metadata for a supported message type.

list_supported_versions() → list[str][source]#

Return supported message types in sorted order.

list_templates() → list[TemplateMetadata][source]#

Return every discovered template.

resolve_paths(message_type: str) → tuple[str, str][source]#

Return bundled template and schema paths for a message type.

search_by_category(category: str) → list[TemplateMetadata][source]#

Return templates whose category matches case-insensitively.