Package: pain001
Pain001: Automate ISO 20022-Compliant Payment File CreationA Powerful Python Library that enables you to create ISO 20022-Compliant Payment Files directly from CSV or SQLite data filesOverviewPain001is an open-source Python Library that you can use to createISO 20022-Compliant Payment Filesdirectly from yourCSVorSQLiteData Files.Website:https://pain001.comSource code:https://github.com/sebastienrousseau/pain001Bug reports:https://github.com/sebastienrousseau/pain001/issuesThe Python library focuses specifically onPayment Initiation and Advice Messages, commonly known asPain. In a very simplified way, apain.001is a message that initiates the customer payment.As of today the library is designed to be compatible with the:Payments Initiation V03 (pain.001.001.03): This version is used for initiating credit transfers within the SEPA (Single Euro Payments Area).Payments Initiation V04 (pain.001.001.04): Introduced support for non-SEPA payments and additional functionalities.Payments Initiation V05 (pain.001.001.05): Brought further enhancements and clarifications.Payments Initiation V06 (pain.001.001.06): Focused on introducing support for instant payments.Payments Initiation V07 (pain.001.001.07): Added support for Request for Large Payment (RLP) and Request to Modify Payment (RTP) functionalities.Payments Initiation V08 (pain.001.001.08): Included support for the TARGET Instant Settlement Service (TISS) and introduced a new pain.002 message type for debit transfers.Payments Initiation V09 (pain.001.001.09): The latest version, which introduced support for Request for Account Information (RAI) functionality.Payments usually start with apain.001 payment initiation message. The payer sends it to the payee (or the payee’s bank) via a secure network. This
network could beSWIFTorSEPA (Single Euro Payments Area) network, or other payment networks such asCHAPS,BACS,Faster Payments, etc. The message contains the payer’s and payee’s bank account details, payment amount, and other information required to process the payment.ThePain001library can reduce payment processing complexity and costs by generating ISO 20022-compliant payment files. These files automatically remove the need to create and validate them manually, making the payment process more efficient and cost-effective. It will save you time and resources and minimises the risk of errors, making sure accurate and seamless payment processing.Use thePain001library to simplify, accelerate and automate your payment processing.Table of ContentsPain001: Automate ISO 20022-Compliant Payment File CreationA Powerful Python Library that enables you to create ISO 20022-Compliant Payment Files directly from CSV or SQLite data filesOverviewTable of ContentsFeaturesRequirementsInstallationInstallvirtualenvCreate a Virtual EnvironmentActivate environmentGetting StartedQuick StartArgumentsExamplesUsing a CSV Data File as the sourceUsing a SQLite Data File as the sourceUsing the Source codeEmbedded in an ApplicationValidationDocumentationSupported messagesBank-to-Customer Cash ManagementPayments Clearing and SettlementPayments InitiationLicenseContributionAcknowledgementsFeaturesEasy to use:Both developers and non-developers can easily use the
library, as it requires minimal coding knowledge.Open-source: The library is open-source and free to use, making it
accessible to everyone.Secure: The library is secure and does not store any sensitive data,
making sure that all information remains confidential.Customizable: The library allows developers to customise the output,
making it adaptable to specific business requirements and preferences.Scalable solution: ThePain001library can handle varying volumes of
payment files, making it suitable for businesses of different sizes and
transaction volumes.Time-saving: The automated file creation process reduces the time spent
on manual data entry and file generation, increasing overall productivity.Seamless integration: As a Python package, the Pain001 library is
compatible with various Python-based applications and easily integrates into
any existing projects or workflows.Cross-border compatibility: The library supports both Single Euro
Payments Area (SEPA) and non-SEPA credit transfers, making it versatile for
use in different countries and regions.Improve accuracyby providing precise data; the library reduces errors in
payment file creation and processing.Enhance efficiencyby automating the creation of Payment Initiation
message filesAccelerate payment file creationby automating the process and reducing
the time required to create payment files.Guarantee the highest quality and complianceby validating all payment
files to meet the ISO 20022 standards.Simplify ISO 20022-compliant payment initiation message creationby
providing a standardised payment file format.Reduce costsby removing manual data entry and file generation, reducing
payment processing time, and reducing errors.RequirementsPain001works with macOS, Linux and Windows and requires Python 3.9.0 and above.InstallationWe recommend creating a virtual environment to installPain001. This will ensure that the package is installed in an isolated environment and will not affect other projects. To installPain001in a virtual environment, follow these steps:Installvirtualenvpython-mpipinstallvirtualenvCreate a Virtual Environmentpython-mvenvvenvCodeExplanation-mexecutes modulevenvenvname of the virtual environmentActivate environmentsourcevenv/bin/activateGetting StartedIt takes just a few seconds to get up and running withPain001. You can install Pain001 from PyPI with pip or your favourite package manager:Open your terminal and run the following command to add the latest version:python-mpipinstallpain001Add the -U switch to update to the current version, ifpain001is already installed.python-mpipinstall-Upain001Quick StartAfter installation, you can runPain001directly from the command line. Simply call the main module pain001 with the paths of your:XML template filecontaining the various parameters you want to pass from your Data file,XSD schema fileto validate the generated XML file, andData file (CSV or SQLite)containing the payment instructions that you want to submit.Here’s how you would do that:python3-mpain001\-t<xml_message_type>\-m<xml_template_file_path>\-s<xsd_schema_file_path>\-d<data_file_path>ArgumentsWhen runningPain001, you will need to specify four arguments:Anxml_message_type: This is the type of XML message you want to generate.The currently supported types are:pain.001.001.03pain.001.001.04pain.001.001.05pain.001.001.06pain.001.001.07pain.001.001.08pain.001.001.09Anxml_template_file_path: This is the path to the XML template file you
are using that contains variables that will be replaced by the values in your
Data file.Anxsd_schema_file_path: This is the path to the XSD schema file you are
using to validate the generated XML file.Adata_file_path: This is the path to the CSV or SQLite Data file you want
to convert to XML format.ExamplesThe following examples demonstrate how to usePain001to generate a payment
initiation message from a CSV file and a SQLite Data file.Using a CSV Data File as the sourcepython3-mpain001\-tpain.001.001.03\-m/path/to/your/template.xml\-s/path/to/your/pain.001.001.03.xsd\-d/path/to/your/template.csvUsing a SQLite Data File as the sourcepython3-mpain001\-tpain.001.001.03\-m/path/to/your/template.xml\-s/path/to/your/pain.001.001.03.xsd\-d/path/to/your/template.dbUsing the Source codeYou can clone the source code and run the example code in your
terminal/command-line. To check out the source code, clone the repository from
GitHub:gitclonehttps://github.com/sebastienrousseau/pain001.gitpython-mpain001\-tpain.001.001.03\-mtemplates/pain.001.001.03/template.xml\-stemplates/pain.001.001.03/pain.001.001.03.xsd\-dtemplates/pain.001.001.03/template.csvThis will generate a payment initiation message from the sample CSV Data file.You can do the same with the sample SQLite Data file:python3-mpain001\-tpain.001.001.03\-mtemplates/pain.001.001.03/template.xml\-stemplates/pain.001.001.03/pain.001.001.03.xsd\-dtemplates/pain.001.001.03/template.dbNote:The XML file thatPain001generates will automatically be
validated against the XSD template file before the new XML file is saved. If
the validation fails,Pain001will stop running and display an error
message in your terminal.Embedded in an ApplicationTo embedPain001in a new or existing application, import the main function
and use it in your code.Here's an example:frompain001importmainif__name__=='__main__':xml_message_type='pain.001.001.03'xml_template_file_path='template.xml'xsd_schema_file_path='schema.xsd'data_file_path='data.csv'main(xml_message_type,xml_template_file_path,xsd_schema_file_path,data_file_path)ValidationTo validate the generated XML file against a given xsd schema, use the
following method:frompain001.coreimportvalidate_xml_against_xsdxml_message_type='pain.001.001.03'xml_file='generated.xml'xsd_file='schema.xsd'is_valid=validate_xml_against_xsd(xml_message_type,xml_file,xsd_file)print(f"XML validation result:{is_valid}")DocumentationInfo:Do check out ourwebsitefor comprehensive documentation.Supported messagesThis section gives access to the documentation related to the ISO 20022
message definitions supported byPain001.Bank-to-Customer Cash ManagementSet of messages used to request and provide account information for
reconciliation and cash positioning between an account servicer and its
customer.StatusMessage typeName⏳camt.052.001.10Bank-to-Customer Account Statement⏳camt.053.001.10Customer Account Identification⏳camt.054.001.10Customer Account Statement Request⏳camt.060.001.10Customer Account NotificationPayments Clearing and SettlementSet of messages used between financial institutions for the clearing and
settlement of payment transactions.StatusMessage typeName⏳pacs.002.001.12Credit Transfer Notification⏳pacs.003.001.09Direct Debit Initiation⏳pacs.004.001.11Direct Debit Reversal⏳pacs.007.001.11Customer Direct Debit Confirmation⏳pacs.008.001.10Credit Transfer Initiation⏳pacs.009.001.10Credit Transfer Reversal⏳pacs.010.001.05Account Identification⏳pacs.028.001.05Account Statement RequestPayments InitiationSet of messages exchanged between a debtor (or buyer) and its bank or
between a creditor (or seller) and its bank to initiate, collect, manage
and monitor payments.StatusMessage typeName✅pain.001.001.03Customer Credit Transfer Initiation✅pain.001.001.04Customer Direct Debit Initiation✅pain.001.001.05Customer Direct Debit Reversal✅pain.001.001.06Customer Credit Transfer Reversal✅pain.001.001.07Customer Account Notification✅pain.001.001.08Customer Account Statement✅pain.001.001.09Customer Credit Transfer Initiation⏳pain.001.001.10Customer Account Closure Request⏳pain.001.001.11Customer Account Change RequestLicenseThe project is licensed under the terms of both the MIT license and the
Apache License (Version 2.0).Apache License, Version 2.0MIT licenseContributionWe welcome contributions toPain001. Please see thecontributing instructionsfor more information.Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the
Apache-2.0 license, shall be dual licensed as above, without any
additional terms or conditions.AcknowledgementsWe would like to extend a big thank you to all the awesome contributors
ofPain001for their help and support.