Skip to main content

Python SEPA XML implementations

Project description

https://travis-ci.org/raphaelm/python-sepaxml.svg?branch=master https://codecov.io/gh/raphaelm/python-sepaxml/branch/master/graph/badge.svg http://img.shields.io/pypi/v/sepaxml.svg

This is a python implementation to generate SEPA XML files.

Limitations

Supported standards:

  • SEPA PAIN.001.001.03

  • SEPA PAIN.001.003.03

  • SEPA PAIN.008.001.02

  • SEPA PAIN.008.002.02

  • SEPA PAIN.008.003.02

Usage

Direct debit

Example:

from sepaxml import SepaDD
import datetime, uuid

config = {
    "name": "Test von Testenstein",
    "IBAN": "NL50BANK1234567890",
    "BIC": "BANKNL2A",
    "batch": True,
    "creditor_id": "DE26ZZZ00000000000",  # supplied by your bank or financial authority
    "currency": "EUR",  # ISO 4217
    # "instrument": "B2B"  # - default is CORE (B2C)
}
sepa = SepaDD(config, schema="pain.008.001.02", clean=True)

payment = {
    "name": "Test von Testenstein",
    "IBAN": "NL50BANK1234567890",
    "BIC": "BANKNL2A",
    "amount": 5000,  # in cents
    "type": "RCUR",  # FRST,RCUR,OOFF,FNAL
    "collection_date": datetime.date.today(),
    "mandate_id": "1234",
    "mandate_date": datetime.date.today(),
    "description": "Test transaction",
    # "endtoend_id": str(uuid.uuid1())  # autogenerated if obmitted
}
sepa.add_payment(payment)

print(sepa.export(validate=True))

Credit transfer

Example:

from sepaxml import SepaTransfer
import datetime, uuid

config = {
    "name": "Test von Testenstein",
    "IBAN": "NL50BANK1234567890",
    "BIC": "BANKNL2A",
    "batch": True,
    # For non-SEPA transfers, set "domestic" to True, necessary e.g. for CH/LI
    "currency": "EUR",  # ISO 4217
}
sepa = SepaTransfer(config, clean=True)

payment = {
    "name": "Test von Testenstein",
    "IBAN": "NL50BANK1234567890",
    "BIC": "BANKNL2A",
    "amount": 5000,  # in cents
    "execution_date": datetime.date.today() + datetime.timedelta(days=2),
    "description": "Test transaction",
    # "endtoend_id": str(uuid.uuid1())  # optional
}
sepa.add_payment(payment)

print(sepa.export(validate=True))

Development

To run the included tests:

pip install -r requirements_dev.txt
py.test tests

To automatically sort your Imports as required by CI:

pip install isort
isort -rc .

Credits and License

Maintainer: Raphael Michel <mail@raphaelmichel.de>

This basically started as a properly packaged, python 3 tested version of the PySepaDD implementation that was released by The Congressus under the MIT license. Thanks for your work!

License: MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sepaxml-2.5.0.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

sepaxml-2.5.0-py3-none-any.whl (40.8 kB view details)

Uploaded Python 3

File details

Details for the file sepaxml-2.5.0.tar.gz.

File metadata

  • Download URL: sepaxml-2.5.0.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for sepaxml-2.5.0.tar.gz
Algorithm Hash digest
SHA256 c5b82a84ae76965b5e5076918d8f2c8a170a8bf27756be0e8a7904a878699422
MD5 9af1b291a134a13f67faa6dee21910f2
BLAKE2b-256 b06b9cd5ec6c267c512975cb212b3cdba0a150894cafd3122c8ab8794e70367f

See more details on using hashes here.

File details

Details for the file sepaxml-2.5.0-py3-none-any.whl.

File metadata

  • Download URL: sepaxml-2.5.0-py3-none-any.whl
  • Upload date:
  • Size: 40.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for sepaxml-2.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06d72ef9514e17e7b59cd49ca898e6aa9f2a895eef4282d03a443faea64f231d
MD5 1791f471ca900f94d19d1ab0d5519ec6
BLAKE2b-256 5e0a4c6db329aa1e5e6b28114b9b3752fc450093b33b843e6f482617715e8165

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page