v0.0.48
Pain001 Release v0.0.48
Release Date: 2026-06-12
Tag: v0.0.48
Python: 3.10+
Status: Stable
Executive Summary
v0.0.48 is the largest release to date: ISO 20022 coverage expands to ten pain.001 versions (.03–.12) plus pain.008 direct debits and pain.002/camt.053 parsers, financial figures flow through Decimal end to end with NbOfTxs/CtrlSum computed from the data, and the toolchain moves to a Python 3.10 floor with a 95% coverage gate, 100% docstring coverage, and 14 Dependabot alerts remediated.
New Features
📨 ISO 20022 Expansion
- pain.001.001.12 — Customer Credit Transfer Initiation, latest version (now 10 versions: .03–.12).
- pain.008.001.02 — Customer Direct Debit Initiation, the first non-pain.001 generator.
- pain.002 parser — read payment status reports returned by banks.
- camt.053 parser — read end-of-day bank statements.
- Version migration —
python -m pain001.migratemaps payment data between pain.001 versions via YAML mappings (generic fallback through v12).
🗂️ Template Registry
- Central registry bundles a Jinja2 template, official XSD, and metadata per message type.
- Schema guardrails detect message-type drift between template and XSD and fail loudly.
- CLI auto-resolves
--template/--schemawhen omitted;--list-templates/--show-templatefor discovery.
💰 Financial Correctness
- Amounts handled with
decimal.Decimalend to end — no float rounding anywhere in the pipeline. NbOfTxsandCtrlSumare computed from the payment rows, never echoed from input.- Strict amount validation: missing, non-numeric, non-positive, or over-precise amounts raise
PaymentValidationError.
⚙️ CLI and Configuration
--dry-run(CI pre-flight),--streaming/--chunk-size,--profilepresets,--show-config,--emit-metrics, deterministic exit codes (0/1/2).- Output defaults to the current directory;
-o/--output-dirselects an explicit destination without changing the working directory. - Configuration manager with YAML/TOML/INI support, schema validation, and built-in presets.
🌐 REST API
- Optional bearer-token auth (
PAIN001_API_KEY), bounded job store, thread-pooled async generation. generate_xml_string()plus streaming loaders for serverless and high-volume workloads.
Bug Fixes
- API generation works end to end for every input type: CSV string values are coerced to the schema's declared types before validation, and Python booleans render as XSD
"true"/"false"(previously"True", which failed XSD validation in v03–v08 templates). - CLI output paths: XML is written to the current directory by default (previously next to the template, which broke with bundled templates);
-ono longer re-anchors relative data paths. - Version migration accepts pain.001.001.12 as a generic mapping target.
- XSD validators log errors via the module logger instead of printing to stdout.
process_files()success check verifies the actually written file and returns its path.
Security Hardening 🛡️
- 14 Dependabot alerts remediated: cryptography 48.0.1, fastapi 0.136.3, starlette 1.2.1, urllib3 2.7.0, requests 2.34.2, idna 3.18, python-dotenv 1.2.2, pyarrow ≥23.0.1, Pygments 2.20.0, and pytest stack bumps.
- CVE-2026-24049: wheel pinned ≥0.46.2.
- Path validator hardened against traversal; all XML parsing through
defusedxml. - Library-safe logging (NullHandler, no root-logger mutation).
Breaking / Behavioural Changes
- Python 3.9 support dropped — the floor is now Python 3.10.
- CLI default output location moved from the template directory to the current working directory.
NbOfTxs/CtrlSuminput values are ignored and recomputed from the data.- FastAPI/uvicorn and pyarrow are now extras:
pip install pain001[api]/pain001[parquet].
Quality
- 1,014 tests passing, 97.7% branch coverage (floor raised 70% → 95%, enforced in CI).
- 100% docstring coverage (interrogate) and zero pydoclint errors, gated in CI.
- Byte-exact golden-file regression tests for every supported message version; property-based (Hypothesis) financial tests; mutation-testing fast gate.
- Runnable
examples/suite executed as part of the test suite.
Installation
pip install --upgrade pain001==0.0.48