Registry / serialization / sepaxml

sepaxml

JSON →
library2.7.0pypypi✓ verified 85d ago

sepaxml is a Python library for creating and parsing SEPA (Single Euro Payments Area) XML files, specifically supporting pain.001.001.03 (Credit Transfer), pain.008.001.02 (Direct Debit), and pain.002.001.03 (Return File) standards. It provides an intuitive API to construct payment instructions and handles XML serialization and deserialization. The current version is 2.7.0, and the library is actively maintained with regular updates to support standards and fix bugs.

pip install sepaxml
INSTALL
IMPORT
SIG · SEPAXML
S
sepaxml
serializationpythonv2.7.0
Install
2.1s avg
Import
Disk
23MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.7.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 24.4MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.1s · import 0.000s · 25MB
23MB installed
● package 23MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SepaDD
from sepaxml import SepaDD
from sepaxml import CreditTransfer
SepaTransfer
from sepaxml import SepaTransfer
debit
from sepaxml import debit

This example demonstrates how to create a basic SEPA Credit Transfer (pain.001) XML file using `sepaxml`. It initializes a `CreditTransfer` object with creditor details and then adds a single payment transaction. Finally, it exports the payment instructions as an XML string.

import datetime from sepaxml import CreditTransfer # Prepare payment details # NOTE: For real use, ensure valid IBANs, BICs, and amounts creditor_name = "My Company Ltd" creditor_iban = "DE98765432109876543210" creditor_bic = "COBADEFFXXX" # BIC is often optional for domestic payments payment = CreditTransfer( schema="pain.001.001.03", iban=creditor_iban, bic=creditor_bic, name=creditor_name, currency="EUR" ) # Add a transaction payment.add_payment( iban="AT123456789012345678", bic="RZSTAT2SXXX", name="Recipient Name", amount=123.45, description="Invoice 12345", collection_date=datetime.date.today() ) # Generate XML xml_string = payment.export() print(xml_string[:500]) # Print first 500 characters of the generated XML # Optional: Save to a file # with open('sepa_credit_transfer.xml', 'w') as f: # f.write(xml_string)
Debug
Known issues
breakingThe `sepaxml.utils` module was removed in version 2.0.0. Functions like `today`, `parse_date`, and `gen_id` are no longer available or have been refactored.
fix
Migrate to standard Python `datetime` for date handling and generate IDs manually if needed. Refer to the current documentation for updated practices.
affects: >=2.0.0
gotchaSEPA XML files are strictly validated against their XSD schemas. Common issues include incorrect IBAN/BIC formats, invalid date formats, or missing mandatory fields.
fix
Ensure all financial identifiers (IBAN, BIC) are valid using a library like `schwifty` (which `sepaxml` uses internally) and that dates are passed as `datetime.date` objects. Consult the SEPA specifications for mandatory fields for your specific message type.
affects: All
gotchaBIC (Bank Identifier Code) is often optional for domestic SEPA payments (within the same country). However, it is still mandatory for cross-border payments outside the Eurozone and for some specific payment types.
fix
Always provide a BIC unless you are certain it's not required for your specific payment scenario (e.g., using `is_bic_optional=True` for direct debits if allowed by your bank). Banks may reject files if an optional BIC is present but incorrect, or if a mandatory BIC is missing.
affects: All
Upgrade
Version history
2.7.0latest on PyPI · released Sep 2, 2025
Audit
Dependencies
lxmlrequiredXML processing and validation
python-dateutilrequiredRobust date parsing and manipulation
schwiftyrequiredIBAN and BIC validation
Agent activity
46 hits · last 30 days
node
40
Resources
sepaxml — pip install sepaxml · libregistry