sepaxml


Namesepaxml JSON
Version 2.7.0 PyPI version JSON
download
home_pagehttps://github.com/raphaelm/python-sepaxml
SummaryPython SEPA XML implementations
upload_time2025-09-02 12:28:15
maintainerNone
docs_urlNone
authorRaphael Michel
requires_pythonNone
licenseMIT License
keywords xml banking sepa
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            SEPA XML Generator
==================

.. image:: https://travis-ci.org/raphaelm/python-sepaxml.svg?branch=master
   :target: https://travis-ci.org/raphaelm/python-sepaxml

.. image:: https://codecov.io/gh/raphaelm/python-sepaxml/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/raphaelm/python-sepaxml

.. image:: http://img.shields.io/pypi/v/sepaxml.svg
   :target: https://pypi.python.org/pypi/sepaxml

This is a python implementation to generate SEPA XML files.

Limitations
-----------

Supported standards:

* SEPA PAIN.001.001.03
* SEPA PAIN.001.001.09
* SEPA PAIN.001.001.10
* SEPA PAIN.001.001.11
* SEPA PAIN.008.001.02
* SEPA PAIN.008.001.08
* SEPA PAIN.008.001.09
* SEPA PAIN.008.001.10

Usage
-----

Direct debit
""""""""""""

Example:

.. code:: python

    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)
        "address": {
            # The address and all of its fields are optional but in some countries they are required
            "address_type": "ADDR",  # valid: ADDR, PBOX, HOME, BIZZ, MLTO, DLVY
            "department": "Head Office",
            "subdepartment": None,
            "street_name": "Musterstr.",
            "building_number": "1",
            "postcode": "12345",
            "town": "Berlin",
            "country": "DE",
            "country_subdivision": None,
            "lines": ["Line 1", "Line 2"],
        },
    }
    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()).replace("-", ""),  # autogenerated if obmitted
        "address": {
            # The address and all of its fields are optional but in some countries they are required
            "address_type": "ADDR",  # valid: ADDR, PBOX, HOME, BIZZ, MLTO, DLVY
            "department": "Head Office",
            "subdepartment": None,
            "street_name": "Musterstr.",
            "building_number": "1",
            "postcode": "12345",
            "town": "Berlin",
            "country": "DE",
            "country_subdivision": None,
            "lines": ["Line 1", "Line 2"],
        },
    }
    sepa.add_payment(payment)

    print(sepa.export(validate=True))


Credit transfer
"""""""""""""""

Example:

.. code:: python

    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
        "address": {
            # The address and all of its fields are optional but in some countries they are required
            "address_type": "ADDR",  # valid: ADDR, PBOX, HOME, BIZZ, MLTO, DLVY
            "department": "Head Office",
            "subdepartment": None,
            "street_name": "Musterstr.",
            "building_number": "1",
            "postcode": "12345",
            "town": "Berlin",
            "country": "DE",
            "country_subdivision": None,
            "lines": ["Line 1", "Line 2"],
        },
    }
    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()).replace("-", ""),  # optional
        "address": {
            # The address and all of its fields are optional but in some countries they are required
            "address_type": "ADDR",  # valid: ADDR, PBOX, HOME, BIZZ, MLTO, DLVY
            "department": "Head Office",
            "subdepartment": None,
            "street_name": "Musterstr.",
            "building_number": "1",
            "postcode": "12345",
            "town": "Berlin",
            "country": "DE",
            "country_subdivision": None,
            "lines": ["Line 1", "Line 2"],
        },
    }
    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 .


Security
--------

If you discover a security issue, please contact us at security@pretix.eu and see our `Responsible Disclosure Policy`_ further information.

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!

The source code is released under MIT license.

Not part of the MIT-licensed project are the XML schemas in the ``sepaxml/schemas/``
folder which are copyrighted by the ISO 20022 organization but `allowed to be reproduced`_
freely.

.. _PySepaDD: https://github.com/congressus/PySepaDD
.. _allowed to be reproduced: https://www.iso20022.org/terms-use
.. _Responsible Disclosure Policy: https://docs.pretix.eu/trust/security/disclosure/

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/raphaelm/python-sepaxml",
    "name": "sepaxml",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "xml banking sepa",
    "author": "Raphael Michel",
    "author_email": "mail@raphaelmichel.de",
    "download_url": "https://files.pythonhosted.org/packages/76/3a/24325baaf9cbc6ee9f6b8c66fe8079e0b8a85c0f21876c0ef52a8c8ddc95/sepaxml-2.7.0.tar.gz",
    "platform": null,
    "description": "SEPA XML Generator\n==================\n\n.. image:: https://travis-ci.org/raphaelm/python-sepaxml.svg?branch=master\n   :target: https://travis-ci.org/raphaelm/python-sepaxml\n\n.. image:: https://codecov.io/gh/raphaelm/python-sepaxml/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/raphaelm/python-sepaxml\n\n.. image:: http://img.shields.io/pypi/v/sepaxml.svg\n   :target: https://pypi.python.org/pypi/sepaxml\n\nThis is a python implementation to generate SEPA XML files.\n\nLimitations\n-----------\n\nSupported standards:\n\n* SEPA PAIN.001.001.03\n* SEPA PAIN.001.001.09\n* SEPA PAIN.001.001.10\n* SEPA PAIN.001.001.11\n* SEPA PAIN.008.001.02\n* SEPA PAIN.008.001.08\n* SEPA PAIN.008.001.09\n* SEPA PAIN.008.001.10\n\nUsage\n-----\n\nDirect debit\n\"\"\"\"\"\"\"\"\"\"\"\"\n\nExample:\n\n.. code:: python\n\n    from sepaxml import SepaDD\n    import datetime, uuid\n\n    config = {\n        \"name\": \"Test von Testenstein\",\n        \"IBAN\": \"NL50BANK1234567890\",\n        \"BIC\": \"BANKNL2A\",\n        \"batch\": True,\n        \"creditor_id\": \"DE26ZZZ00000000000\",  # supplied by your bank or financial authority\n        \"currency\": \"EUR\",  # ISO 4217\n        # \"instrument\": \"B2B\",  # - default is CORE (B2C)\n        \"address\": {\n            # The address and all of its fields are optional but in some countries they are required\n            \"address_type\": \"ADDR\",  # valid: ADDR, PBOX, HOME, BIZZ, MLTO, DLVY\n            \"department\": \"Head Office\",\n            \"subdepartment\": None,\n            \"street_name\": \"Musterstr.\",\n            \"building_number\": \"1\",\n            \"postcode\": \"12345\",\n            \"town\": \"Berlin\",\n            \"country\": \"DE\",\n            \"country_subdivision\": None,\n            \"lines\": [\"Line 1\", \"Line 2\"],\n        },\n    }\n    sepa = SepaDD(config, schema=\"pain.008.001.02\", clean=True)\n\n    payment = {\n        \"name\": \"Test von Testenstein\",\n        \"IBAN\": \"NL50BANK1234567890\",\n        \"BIC\": \"BANKNL2A\",\n        \"amount\": 5000,  # in cents\n        \"type\": \"RCUR\",  # FRST,RCUR,OOFF,FNAL\n        \"collection_date\": datetime.date.today(),\n        \"mandate_id\": \"1234\",\n        \"mandate_date\": datetime.date.today(),\n        \"description\": \"Test transaction\",\n        # \"endtoend_id\": str(uuid.uuid1()).replace(\"-\", \"\"),  # autogenerated if obmitted\n        \"address\": {\n            # The address and all of its fields are optional but in some countries they are required\n            \"address_type\": \"ADDR\",  # valid: ADDR, PBOX, HOME, BIZZ, MLTO, DLVY\n            \"department\": \"Head Office\",\n            \"subdepartment\": None,\n            \"street_name\": \"Musterstr.\",\n            \"building_number\": \"1\",\n            \"postcode\": \"12345\",\n            \"town\": \"Berlin\",\n            \"country\": \"DE\",\n            \"country_subdivision\": None,\n            \"lines\": [\"Line 1\", \"Line 2\"],\n        },\n    }\n    sepa.add_payment(payment)\n\n    print(sepa.export(validate=True))\n\n\nCredit transfer\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nExample:\n\n.. code:: python\n\n    from sepaxml import SepaTransfer\n    import datetime, uuid\n\n    config = {\n        \"name\": \"Test von Testenstein\",\n        \"IBAN\": \"NL50BANK1234567890\",\n        \"BIC\": \"BANKNL2A\",\n        \"batch\": True,\n        # For non-SEPA transfers, set \"domestic\" to True, necessary e.g. for CH/LI\n        \"currency\": \"EUR\",  # ISO 4217\n        \"address\": {\n            # The address and all of its fields are optional but in some countries they are required\n            \"address_type\": \"ADDR\",  # valid: ADDR, PBOX, HOME, BIZZ, MLTO, DLVY\n            \"department\": \"Head Office\",\n            \"subdepartment\": None,\n            \"street_name\": \"Musterstr.\",\n            \"building_number\": \"1\",\n            \"postcode\": \"12345\",\n            \"town\": \"Berlin\",\n            \"country\": \"DE\",\n            \"country_subdivision\": None,\n            \"lines\": [\"Line 1\", \"Line 2\"],\n        },\n    }\n    sepa = SepaTransfer(config, clean=True)\n\n    payment = {\n        \"name\": \"Test von Testenstein\",\n        \"IBAN\": \"NL50BANK1234567890\",\n        \"BIC\": \"BANKNL2A\",\n        \"amount\": 5000,  # in cents\n        \"execution_date\": datetime.date.today() + datetime.timedelta(days=2),\n        \"description\": \"Test transaction\",\n        # \"endtoend_id\": str(uuid.uuid1()).replace(\"-\", \"\"),  # optional\n        \"address\": {\n            # The address and all of its fields are optional but in some countries they are required\n            \"address_type\": \"ADDR\",  # valid: ADDR, PBOX, HOME, BIZZ, MLTO, DLVY\n            \"department\": \"Head Office\",\n            \"subdepartment\": None,\n            \"street_name\": \"Musterstr.\",\n            \"building_number\": \"1\",\n            \"postcode\": \"12345\",\n            \"town\": \"Berlin\",\n            \"country\": \"DE\",\n            \"country_subdivision\": None,\n            \"lines\": [\"Line 1\", \"Line 2\"],\n        },\n    }\n    sepa.add_payment(payment)\n\n    print(sepa.export(validate=True))\n\n\nDevelopment\n-----------\n\nTo run the included tests::\n\n    pip install -r requirements_dev.txt\n    py.test tests\n\nTo automatically sort your Imports as required by CI::\n\n    pip install isort\n    isort -rc .\n\n\nSecurity\n--------\n\nIf you discover a security issue, please contact us at security@pretix.eu and see our `Responsible Disclosure Policy`_ further information.\n\nCredits and License\n-------------------\n\nMaintainer: Raphael Michel <mail@raphaelmichel.de>\n\nThis basically started as a properly packaged, python 3 tested version\nof the `PySepaDD`_ implementation that was released by The Congressus under the MIT license.\nThanks for your work!\n\nThe source code is released under MIT license.\n\nNot part of the MIT-licensed project are the XML schemas in the ``sepaxml/schemas/``\nfolder which are copyrighted by the ISO 20022 organization but `allowed to be reproduced`_\nfreely.\n\n.. _PySepaDD: https://github.com/congressus/PySepaDD\n.. _allowed to be reproduced: https://www.iso20022.org/terms-use\n.. _Responsible Disclosure Policy: https://docs.pretix.eu/trust/security/disclosure/\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Python SEPA XML implementations",
    "version": "2.7.0",
    "project_urls": {
        "Homepage": "https://github.com/raphaelm/python-sepaxml"
    },
    "split_keywords": [
        "xml",
        "banking",
        "sepa"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1d067128b1dee5d616587b5e83597d1e6a651c56668820c3b8f2d7e870c1ae76",
                "md5": "aff812a21f7a581e1ad87dd729e14f53",
                "sha256": "6644f695c66c2bf8f49065d4d7b0814da42140d03292131ec08e09798ad07b5d"
            },
            "downloads": -1,
            "filename": "sepaxml-2.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aff812a21f7a581e1ad87dd729e14f53",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 60537,
            "upload_time": "2025-09-02T12:28:14",
            "upload_time_iso_8601": "2025-09-02T12:28:14.702760Z",
            "url": "https://files.pythonhosted.org/packages/1d/06/7128b1dee5d616587b5e83597d1e6a651c56668820c3b8f2d7e870c1ae76/sepaxml-2.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "763a24325baaf9cbc6ee9f6b8c66fe8079e0b8a85c0f21876c0ef52a8c8ddc95",
                "md5": "56a956b2e56831885a6f93387e222151",
                "sha256": "77c6ea8c4ea59e53dcabed1d5d8bb79559a0aac47cf25c8e78b06ff5fef6c2bd"
            },
            "downloads": -1,
            "filename": "sepaxml-2.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "56a956b2e56831885a6f93387e222151",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 53222,
            "upload_time": "2025-09-02T12:28:15",
            "upload_time_iso_8601": "2025-09-02T12:28:15.783797Z",
            "url": "https://files.pythonhosted.org/packages/76/3a/24325baaf9cbc6ee9f6b8c66fe8079e0b8a85c0f21876c0ef52a8c8ddc95/sepaxml-2.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-02 12:28:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "raphaelm",
    "github_project": "python-sepaxml",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "sepaxml"
}
        
Elapsed time: 0.65733s