sepaxml


Namesepaxml JSON
Version 2.6.2 PyPI version JSON
download
home_pagehttps://github.com/raphaelm/python-sepaxml
SummaryPython SEPA XML implementations
upload_time2024-11-19 14:03:18
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.008.001.02

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 .


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

            

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/ad/89/6ebe206cc660d840183183a940c7d39c134c28841de4f2126584f6aa54a9/sepaxml-2.6.2.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.008.001.02\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\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",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Python SEPA XML implementations",
    "version": "2.6.2",
    "project_urls": {
        "Homepage": "https://github.com/raphaelm/python-sepaxml"
    },
    "split_keywords": [
        "xml",
        "banking",
        "sepa"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b1e2976ab01d28a0e4e25dc35e166b88eceb1bbcf2bd3b6ca85a7ebe3ad2faa3",
                "md5": "c14d680ee6a3783a6c01e946788c54c7",
                "sha256": "2713adcc4e4d7893166382837351e7bd34cefebd9dab702389a1c051e2ee7066"
            },
            "downloads": -1,
            "filename": "sepaxml-2.6.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c14d680ee6a3783a6c01e946788c54c7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 26976,
            "upload_time": "2024-11-19T14:03:16",
            "upload_time_iso_8601": "2024-11-19T14:03:16.026434Z",
            "url": "https://files.pythonhosted.org/packages/b1/e2/976ab01d28a0e4e25dc35e166b88eceb1bbcf2bd3b6ca85a7ebe3ad2faa3/sepaxml-2.6.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ad896ebe206cc660d840183183a940c7d39c134c28841de4f2126584f6aa54a9",
                "md5": "dc40763eebe12fbd847a9131078086fb",
                "sha256": "1f6f747bb4e15a12af1034964424c9cc17481127229e8d95693a5a96a3267561"
            },
            "downloads": -1,
            "filename": "sepaxml-2.6.2.tar.gz",
            "has_sig": false,
            "md5_digest": "dc40763eebe12fbd847a9131078086fb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 23946,
            "upload_time": "2024-11-19T14:03:18",
            "upload_time_iso_8601": "2024-11-19T14:03:18.618546Z",
            "url": "https://files.pythonhosted.org/packages/ad/89/6ebe206cc660d840183183a940c7d39c134c28841de4f2126584f6aa54a9/sepaxml-2.6.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-19 14:03:18",
    "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: 4.87350s