Skip to main content

Pain001 logo

Pain001

Generate and validate ISO 20022 payment files from tabular data.

Build Registry Docs OpenSSF Scorecard License: Apache-2.0 OR MIT Python 3.10 or newer


Contents

Getting started

The Pain001 ecosystem

Library reference

Operational


Install

As a Python library

python -m pip install pain001

Optional extras include api, parquet, redis, mcp, lsp, gpg, and otel. Version 0.0.71 adds rules (CEL policies) and upload (SFTP). Until that release is published, install these additions from source.

# Development checkout, including unreleased features
git clone --branch feat/v0.0.72 https://github.com/sebastienrousseau/pain001.git
cd pain001
poetry install --all-extras --with dev,docs

# Published container (CLI and REST API)
docker pull ghcr.io/sebastienrousseau/pain001:latest

Docker runs as a non-root user. Mount a writable directory at /data and use -w /data; generate -t pain.001.001.03 -d payments.csv -o output writes into an output directory, not a filename. No distro package or standalone native binary is claimed; see packaging.


Requirements

Python 3.10 or newer; CI tests Python 3.10–3.14 on Linux. Development uses Python 3.12 and Poetry. Optional integrations require their extras and, for GPG, the system GnuPG executable. No distro-system-Python compatibility is claimed. See toolchain policy.


Quick Start

pain001 init pain.001.001.03 -o payments.csv
pain001 validate -t pain.001.001.03 -d payments.csv
pain001 generate -t pain.001.001.03 -d payments.csv -o output

Run in a fresh writable directory. The scaffold uses bundled synthetic data; replace it with your own records before a real payment workflow. Generation validates the rendered XML against the bundled XSD before writing it. A dry run checks data but is not a bank acceptance guarantee.


The Pain001 ecosystem

Core, MCP, LSP, XLSX and MT101 packages follow the coordinated version policy; see suite policy. The new plugin scaffold and mockbank start separately at unreleased 0.0.1. Issue acceptance status distinguishes branch work from released packages. Companion packages are independently installed.

Component Purpose Use case
pain001 Generation, validation, CLI and REST Payment-file pipelines
pain001-mcp Agent tools Standalone MCP service; in-tree alternative uses the mcp extra
pain001-lsp Editor integration Standalone JSON diagnostics; in-tree LSP handles CSV
pain001-loader-xlsx Excel loader plugin Install alongside core for .xlsx / .xlsm; first sheet only, reject numeric IBAN and datetime cells
pain001-loader-mt101 MT101 loader plugin Convert supported MT101 inputs
pain001-plugin-template Cookiecutter scaffold Develop an external plugin
pain001-mockbank Synthetic SFTP test service Generate pain.002 replies; development image ghcr.io/sebastienrousseau/pain001-mockbank:edge

Capabilities at a glance

Area Capability Status
XML output pain.001.001.03–13 and pain.008.001.02 / .08 Bundled XSD and golden-file tests
Input CSV, SQLite, JSON, JSONL, Python records; optional Parquet and plugins Tested loaders
Validation XSD, scheme profiles including anti-duplicate, rail rules and optional CEL Policies do not replace bank certification
Delivery Explicit SFTP upload with pinned host trust upload extra, added in 0.0.71
Corrections Deterministic review-only suggestions; no financial-field correction Core and companion MCP tool, added in 0.0.71

Ecosystem comparison

This matrix describes the repository's scope, not an independently benchmarked comparison with competitors.

Project Generate payment XML Real settlement Synthetic bank replies
Pain001 Yes No pain.002 builder; mockbank companion

See docs/COMPARISON.md for the evidence and complete matrix.


Benchmarks

CI smoke-runs benchmarks. No hardware-independent throughput or latency promise is made; use the generated run report for measurements.

Scenario Result Environment
Generation and corpus benchmarks Run-specific Python, hardware and dependency versions recorded per run

See docs/BENCHMARKS.md for methodology and full results.


Features

  • Generate validated XML to files or in memory through generate_xml_string. Streaming produces one file per chunk with recomputed control totals.
  • Discover bundled message types with pain001 versions and inspect metadata with pain001 inspect. Inputs, templates and schemas are described in the user guide and input-column reference.
  • Compose scheme profiles, including anti-duplicate; see SCHEMES.md. CEL rules (added in 0.0.71) apply before generation through CLI and REST. Account currency is never inferred from an IBAN.
  • Extend loaders, validators, schemes and writers through the plugin contract and XLSX worked example. Plugins run with the process's privileges; they are not sandboxed.
  • Use SFTP upload explicitly; generation never sends a payment automatically. Host trust is checked before authentication.
  • Request suggest_record_fix via MCP for review-only corrections. IBANs, BICs, amounts and currencies are refused, not guessed; see correction decisions.
  • Parse pain.002 status reports and camt.053 statements; build synthetic pain.002 reports. This is not a settlement engine.
  • Run REST with pain001 serve, MCP with pain001 mcp, or the CSV language server with pain001-lsp-builtin, after installing the corresponding extras.
  • Generate typed clients from openapi.json; see the public API reference.
  • Browse the example corpus, JSON twins, and message deltas. Confidence/provenance records describe the evidence for each scenario; they do not certify a bank's acceptance.

Configuration

Use pain001 generate --help, pain001 upload --help, and pain001 plugins --help for the current command options rather than a copied flag list. YAML, TOML and INI configuration and profiles are described in configuration.

PAIN001_API_KEY enables API authentication; configure rate limits and shared job storage before multi-replica deployments. PAIN001_DISABLE_PLUGINS disables named plugins, and OTEL_ENABLED enables optional tracing. See OPERATIONS.md and the deployment cookbook. Never commit keys, credentials or real payment data.


Examples

The numbered examples cover generation, input formats, REST, MCP, streaming, schemes, parsers and corpus access; CI executes them. The Quick Start above is also exercised directly by a documentation regression test.


When not to use Pain001

  • XSD validity and scheme checks do not guarantee bank acceptance, regulatory compliance, or settlement. Validate against your bank's authorized rules.
  • EBICS, AS2, SWIFT connectivity and real settlement simulation are not provided. Only the explicit SFTP adapter is implemented here.
  • camt.053 is a parser, not a statement generator; unrelated ISO families are outside scope. Inputs must be row-shaped records or a supported plugin format.
  • Third-party plugins execute arbitrary Python with your process privileges.
  • The project has one maintainer; independent plugin-author validation for issue #179 remains outstanding. Development-branch changes are not releases.

Development

poetry install --all-extras --with dev,docs
poetry run make check
poetry run make type
poetry run python scripts/render_readme.py --check
poetry run make docs

The coverage floor is 100% line and branch. make check runs lint, coverage, security and corpus checks; make type is a separate required gate. Pull requests also run mutation testing, benchmarks, SDK and container checks. See DEVELOPMENT.md for the complete gate map and CONTRIBUTING.md for signed commits and DCO.

README layout is generated from the portfolio template vendored at docs/readme-template.md, with evidence in docs/readme-values.json. Edit the values and regenerate with scripts/render_readme.py; CI checks drift. No fixed test count is advertised because it changes with the branch.


Security

Report security problems privately, never in a public issue.

Untrusted inbound XML uses hardened parsing and rendered XML is XSD-validated. The build uses locked dependencies and audited CI installation inputs. Actions are SHA-pinned except the explicitly accepted SLSA generator v2.1.0 references required for upstream provenance verification; see the security audit. Atheris and Hypothesis exercise validation paths; no OSS-Fuzz integration is claimed.

The maintainer-approved solo workflow requires PRs, status checks, conversation resolution and administrator enforcement, but zero mandatory approving reviews and no mandatory CODEOWNER approval. This is not independent review and does not resolve historical review findings. See governance.

Report vulnerabilities according to SECURITY.md.


Documentation

What is pain.001? · User manual · API reference · Developer guide · Ecosystem map

Also see architecture, support, release process, changelog, issue acceptance and security audit.


Stability guarantees

Versions advance one step at a time on the 0.0.x line, with 0.1.0 after 0.0.999; only the maintainer opens a release. This branch prepares 0.0.72; publication requires approved release PRs and signed release tags.

Generated XML changes for identical input, required fields, CLI/REST/MCP contracts and plugin contracts are breaking changes. They must be announced one release ahead; deprecated interfaces remain for at least one release with a warning. Golden files guard byte-exact output. Coordinated suite releases follow ADR-0001. Toolchain changes follow ADR-0004, not incidental dependency updates.


License

Dual-licensed under Apache-2.0 OR MIT, at your option. See LICENSE. Dependencies retain their own licences.

Metadata

Release files for pain001 0.0.72

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pain001 0.0.72
File Size Uploaded
pain001-0.0.72.tar.gz 669.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pain001 0.0.72
File Interpreter ABI Platform
pain001-0.0.72-py3-none-any.whl Python 3 none any Details

Total release size: 1.8 MB

Release files / pain001-0.0.72.tar.gz

Download URL pain001-0.0.72.tar.gz
Size 669.8 kB
Tags Source
SHA-256 checksum
How to use checksums
413be466879b594daf83a3094f008f2b0b48be80fe09128dff208cd2541cf34c
BLAKE2b-256 checksum
How to use checksums
a1fdd2ee6132186c9222c708a769fcb4b9e65ae1e09f1122396b1858196d7497
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release files / pain001-0.0.72-py3-none-any.whl

Download URL pain001-0.0.72-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9b67287e29773b49eedd255626a5916bde000143d244913d467f45fbfe24d4a4
BLAKE2b-256 checksum
How to use checksums
8b89ba285fee31c08340e1dd5cb78bd7d8f2f373b29c8d602bac6bfc6ad351bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.72 This release

2 release files

0.0.71

2 release files

0.0.70

2 release files

0.0.69

2 release files

0.0.68

2 release files

0.0.67

2 release files

0.0.66

2 release files

0.0.65

2 release files

0.0.62

2 release files

0.0.61

2 release files

0.0.60

2 release files

0.0.59

2 release files

0.0.58

2 release files

0.0.57

2 release files

0.0.56

2 release files

0.0.55

2 release files

0.0.54

2 release files

0.0.53

2 release files

0.0.52

2 release files

0.0.51

2 release files

0.0.50

2 release files

0.0.49

2 release files

0.0.48

2 release files

0.0.47

2 release files

0.0.46

2 release files

0.0.45

2 release files

0.0.44

2 release files

0.0.43

3 release files

0.0.42

2 release files

0.0.41

2 release files

0.0.40

2 release files

0.0.39

2 release files

0.0.38

2 release files

0.0.37

2 release files

0.0.36

2 release files

0.0.35

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page