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.003.03
* SEPA PAIN.008.001.02
* SEPA PAIN.008.002.02
* SEPA PAIN.008.003.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!
License: MIT
.. _PySepaDD: https://github.com/congressus/PySepaDD
Raw data
{
"_id": null,
"home_page": "https://github.com/raphaelm/python-sepaxml",
"name": "sepaxml",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "xml banking sepa",
"author": "Raphael Michel",
"author_email": "mail@raphaelmichel.de",
"download_url": "https://files.pythonhosted.org/packages/22/38/dd0d802f03025acd15b20ab8180ef4d3a90c6478b5d43a4c11606c5b723e/sepaxml-2.6.1.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.003.03\n* SEPA PAIN.008.001.02\n* SEPA PAIN.008.002.02\n* SEPA PAIN.008.003.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\nLicense: MIT\n\n.. _PySepaDD: https://github.com/congressus/PySepaDD\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Python SEPA XML implementations",
"version": "2.6.1",
"project_urls": {
"Homepage": "https://github.com/raphaelm/python-sepaxml"
},
"split_keywords": [
"xml",
"banking",
"sepa"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "61b876d321077eca630b270b1ae03883936547a701a3ac8c91ad19216cf021cf",
"md5": "1bed7be6eef52764559d644885197994",
"sha256": "f110e4a11322c1ea46f86550d703468b109343b4cece1d5b792d394f03d86110"
},
"downloads": -1,
"filename": "sepaxml-2.6.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1bed7be6eef52764559d644885197994",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 41714,
"upload_time": "2022-11-29T21:19:31",
"upload_time_iso_8601": "2022-11-29T21:19:31.304693Z",
"url": "https://files.pythonhosted.org/packages/61/b8/76d321077eca630b270b1ae03883936547a701a3ac8c91ad19216cf021cf/sepaxml-2.6.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2238dd0d802f03025acd15b20ab8180ef4d3a90c6478b5d43a4c11606c5b723e",
"md5": "d9727a36ad9af08d6fd6f5d4300a988b",
"sha256": "939c12236779e6a3d7221d3557921abd6e30b0bfd369e67815ea55bccaacd688"
},
"downloads": -1,
"filename": "sepaxml-2.6.1.tar.gz",
"has_sig": false,
"md5_digest": "d9727a36ad9af08d6fd6f5d4300a988b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 34820,
"upload_time": "2022-11-29T21:19:34",
"upload_time_iso_8601": "2022-11-29T21:19:34.206581Z",
"url": "https://files.pythonhosted.org/packages/22/38/dd0d802f03025acd15b20ab8180ef4d3a90c6478b5d43a4c11606c5b723e/sepaxml-2.6.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-11-29 21:19:34",
"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"
}