|
2 | 2 |
|
3 | 3 | <img
|
4 | 4 | src="https://kura.pro/pain001/images/logos/pain001.svg"
|
5 |
| - alt="Pain001 logo" |
| 5 | + alt="Pain001 Logo" |
6 | 6 | height="261"
|
7 | 7 | width="261"
|
8 | 8 | align="right"
|
9 | 9 | />
|
10 | 10 |
|
11 | 11 | <!-- markdownlint-enable MD033 MD041 -->
|
12 | 12 |
|
13 |
| -# Python Pain001 |
| 13 | +# Pain001 - A Python Library for Automating ISO 20022-Compliant Payment Files Using CSV Data |
14 | 14 |
|
15 | 15 | ![Pain001 banner][banner]
|
16 | 16 |
|
17 | 17 | [![PyPI][pypi-badge]][3] [![License][license-badge]][1]
|
18 | 18 | [![Codecov][codecov-badge]][6]
|
19 | 19 |
|
20 |
| -## Overview 📖 |
| 20 | +**Pain001** is a Python Library for Automating ISO 20022-Compliant Payment |
| 21 | +Files Using CSV Data. |
21 | 22 |
|
22 |
| -The `Pain001` Python package is a CLI tool that makes it easy to |
23 |
| -automate the creation of ISO20022-compliant payment files directly from |
24 |
| -a CSV file. |
| 23 | +**Pain001** offers a streamlined solution for reducing complexity and costs |
| 24 | +associated with payment processing. By providing a simple and efficient method |
| 25 | +to create ISO 20022-compliant payment files, it eliminates the manual effort of |
| 26 | +file creation and validation. This not only saves valuable time and resources |
| 27 | +but also minimizes the risk of errors, ensuring accurate and seamless payment |
| 28 | +processing. |
25 | 29 |
|
26 |
| -With `Pain001`, you can easily create payment transactions files in just |
27 |
| -a few simple steps. |
| 30 | +If you are seeking to simplify and automate your payment processing, consider |
| 31 | +leveraging the capabilities of **Pain001**. |
28 | 32 |
|
29 |
| -The library supports both **Single Euro Payments Area (SEPA)** and |
30 |
| -**non-SEPA credit transfers**, making it versatile for use in different |
31 |
| -countries and regions. |
| 33 | +## Features ✨ |
| 34 | + |
| 35 | +- **Easy to use:** The library is easy to use and requires minimal coding |
| 36 | + knowledge, making it suitable for both developers and non-developers. |
| 37 | +- **Open-source**: The library is open-source and free to use, making it |
| 38 | + accessible to everyone. |
| 39 | +- **Secure**: The library is secure and does not store any sensitive data, |
| 40 | + ensuring that all information remains confidential. |
| 41 | +- **Customizable**: The library allows developers to customize the output, |
| 42 | + making it adaptable to specific business requirements and preferences. |
| 43 | +- **Scalable solution**: The **Pain001** library can handle varying volumes of |
| 44 | + payment files, making it suitable for businesses of different sizes and |
| 45 | + transaction volumes. |
| 46 | +- **Time-saving**: The automated file creation process reduces the time spent |
| 47 | + on manual data entry and file generation, increasing overall productivity. |
| 48 | +- **Seamless integration**: As a Python package, the **Pain001** library is |
| 49 | + compatible with various Python-based applications and easily integrates into |
| 50 | + any existing projects or workflows. |
| 51 | +- **Cross-border compatibility**: The library supports both Single Euro |
| 52 | + Payments Area (SEPA) and non-SEPA credit transfers, making it versatile for |
| 53 | + use in different countries and regions. |
| 54 | +- **Improve accuracy** by providing precise data, the library reduces errors in |
| 55 | + payment file creation and processing. |
| 56 | +- **Enhance efficiency** by automating the creation of Payment Initiation |
| 57 | + message files |
| 58 | +- **Accelerate payment file creation** by automating the process and reducing |
| 59 | + the time required to create payment files. |
| 60 | +- **Guarantee the highest quality and compliance** by validating all payment |
| 61 | + files to meet the ISO 20022 standards. |
| 62 | +- **Provide flexibility and choice to migrate to any supported ISO 20022 |
| 63 | + messaging standard definitions** by simplifying the message creation process |
| 64 | + and providing a standardized format for payment files. |
| 65 | + |
| 66 | +## Installation |
| 67 | + |
| 68 | +It takes just a few seconds to get up and running with **Pain001**. Open your |
| 69 | +terminal and run the following command: |
| 70 | + |
| 71 | +```sh |
| 72 | +pip install pain001 |
| 73 | +``` |
| 74 | + |
| 75 | +## Usage |
| 76 | + |
| 77 | +After installation, you can run **Pain001** directly from the command line. |
| 78 | +Simply call the main function with the path of your XML template file, XSD |
| 79 | +schema file and the path of your CSV file containing the payment data. |
| 80 | + |
| 81 | +Once you have installed **Pain001**, you can generate and validate XML files |
| 82 | +using the following command: |
| 83 | + |
| 84 | +```sh |
| 85 | +python3 -m pain001 \ |
| 86 | + <xml_message_type> \ |
| 87 | + <xml_file_path> \ |
| 88 | + <xsd_file_path> \ |
| 89 | + <csv_file_path> |
| 90 | +``` |
| 91 | + |
| 92 | +## Arguments |
| 93 | + |
| 94 | +When running **Pain001**, you will need to specify four arguments: |
| 95 | + |
| 96 | +- `xml_message_type`: This is the type of XML message you want to generate. |
| 97 | + Currently, the valid options are: |
| 98 | + - pain.001.001.03 |
| 99 | + - pain.001.001.09 |
| 100 | +- `xml_file_path`: This is the path to the XML template file you are using. |
| 101 | +- `xsd_file_path`: This is the path to the XSD template file you are using. |
| 102 | +- `csv_file_path`: This is the path to the CSV data file you want to convert |
| 103 | + to XML. |
| 104 | + |
| 105 | +## Examples |
| 106 | + |
| 107 | +Here are a few example on how to use **Pain001** to generate a |
| 108 | +pain.001.001.03 XML file from a CSV data file: |
| 109 | + |
| 110 | +### Via the Command Line |
| 111 | + |
| 112 | +```sh |
| 113 | +python3 -m pain001 \ |
| 114 | + pain.001.001.03 \ |
| 115 | + /path/to/your/pain.001.001.03.xml \ |
| 116 | + /path/to/your/pain.001.001.03.xsd \ |
| 117 | + /path/to/your/pain.001.001.03.csv |
| 118 | +``` |
| 119 | + |
| 120 | +**Note:** The XML file that **Pain001** generates will be automatically |
| 121 | +validated against the XSD template file before the new XML file is saved. If |
| 122 | +the validation fails, **Pain001** will stop running and display an error |
| 123 | +message in your terminal. |
| 124 | + |
| 125 | +### Embedded in an Application |
| 126 | + |
| 127 | +To embed **Pain001** in a new or existing application, import the main function |
| 128 | +and use it in your code. |
| 129 | + |
| 130 | +Here's an example: |
| 131 | + |
| 132 | +```python |
| 133 | +from pain001 import main |
| 134 | + |
| 135 | +if __name__ == '__main__': |
| 136 | + xml_message_type = 'pain.001.001.03' |
| 137 | + xml_file_path = 'template.xml' |
| 138 | + xsd_file_path = 'schema.xsd' |
| 139 | + csv_file_path = 'data.csv' |
| 140 | + main(xml_message_type, xml_file_path, xsd_file_path, csv_file_path) |
| 141 | +``` |
| 142 | + |
| 143 | +### Validation |
| 144 | + |
| 145 | +To validate the generated XML file against a given xsd schema, use the |
| 146 | +following method: |
| 147 | + |
| 148 | +```python |
| 149 | +from pain001.core import validate_xml_against_xsd |
| 150 | + |
| 151 | +xml_message_type = 'pain.001.001.03' |
| 152 | +xml_file = 'generated.xml' |
| 153 | +xsd_file = 'schema.xsd' |
| 154 | + |
| 155 | +is_valid = validate_xml_against_xsd( |
| 156 | + xml_message_type, |
| 157 | + xml_file, |
| 158 | + xsd_file |
| 159 | +) |
| 160 | +print(f"XML validation result: {is_valid}") |
| 161 | +``` |
32 | 162 |
|
33 |
| -## ISO 20022 Payment Initiation Message Types 📨 |
| 163 | +## Documentation 📖 |
| 164 | + |
| 165 | +> ℹ️ **Info:** Do check out our [website][0] for more information. |
| 166 | +
|
| 167 | +### Payment Messages |
34 | 168 |
|
35 | 169 | The following **ISO 20022 Payment Initiation message types** are
|
36 | 170 | currently supported:
|
37 | 171 |
|
38 |
| -* **pain.001.001.03** - Customer Credit Transfer Initiation |
| 172 | +- **pain.001.001.03** - Customer Credit Transfer Initiation |
39 | 173 |
|
40 | 174 | This message is used to transmit credit transfer instructions from the
|
41 |
| -originator (the party initiating the payment) to the originator's bank. |
42 |
| -The message supports both bulk and single payment instructions, allowing |
43 |
| -for the transmission of multiple payments in a batch or individual |
44 |
| -payments separately. The pain.001.001.03 message format is part of the |
45 |
| -ISO 20022 standard and is commonly used for SEPA Credit Transfers within |
46 |
| -the Single Euro Payments Area. It includes relevant information such as |
47 |
| -the originator's and beneficiary's details, payment amounts, payment |
48 |
| -references, and other transaction-related information required for |
49 |
| -processing the credit transfers. |
50 |
| - |
51 |
| -* **pain.001.001.09** - Customer Credit Transfer Initiation |
52 |
| - |
53 |
| -This message format is part of the ISO 20022 standard and is commonly |
54 |
| -used for SEPA Credit Transfers within the Single Euro Payments Area. It |
55 |
| -enables the transmission of credit transfer instructions from the |
56 |
| -originator to the originator's bank. The message includes essential |
57 |
| -information such as the originator's and beneficiary's details, payment |
58 |
| -amounts, payment references, and other transaction-related information |
59 |
| -required for processing the credit transfers. |
60 |
| - |
61 |
| -More message types will be added in the future. Please refer to the |
62 |
| -[supported messages section][supported-messages] section for more |
63 |
| -details. |
64 |
| - |
65 |
| -## Features ✨ |
66 |
| - |
67 |
| -* **Simplify file creation:** The library generates payment files in |
68 |
| - the desired format quickly and efficiently. |
69 |
| -* **Ensure the highest quality and compliance:** The library |
70 |
| - guarantees that all created payment files follow the ISO 20022 |
71 |
| - standards. |
72 |
| -* **Enhance efficiency:** The Pain001 library automates the creation of |
73 |
| - Payment Initiation message files, freeing developers to focus on other |
74 |
| - aspects of their projects and simplifying the payment process for |
75 |
| - users. |
76 |
| -* **Improve accuracy:** By providing precise data, the library reduces |
77 |
| - errors in payment file creation and processing. |
78 |
| -* **Seamless integration:** As a Python package, the Pain001 library is |
79 |
| - compatible with various Python-based applications and easily |
80 |
| - integrates into any existing projects or workflows. |
81 |
| -* **Cross-border compatibility:** The library supports both Single Euro |
82 |
| - Payments Area (SEPA) and non-SEPA credit transfers, making it |
83 |
| - versatile for use in different countries and regions. |
84 |
| -* **Time-saving:** The automated file creation process reduces the time |
85 |
| - spent on manual data entry and file generation, increasing overall |
86 |
| - productivity. |
87 |
| -* **Scalable solution:** The Pain001 library can handle varying volumes |
88 |
| - of payment files, making it suitable for businesses of different sizes |
89 |
| - and transaction volumes. |
90 |
| -* **Customisable:** The library allows developers to customise the |
91 |
| - output, making it adaptable to specific business requirements and |
92 |
| - preferences. |
| 175 | +originator (the party initiating the payment) to the originator's bank. The |
| 176 | +message supports both bulk and single payment instructions, allowing for the |
| 177 | +transmission of multiple payments in a batch or individual payments separately. |
| 178 | +The pain.001.001.03 message format is part of the ISO 20022 standard and is |
| 179 | +commonly used for SEPA Credit Transfers within the Single Euro Payments Area. |
| 180 | +It includes relevant information such as the originator's and beneficiary's |
| 181 | +details, payment amounts, payment references, and other transaction-related |
| 182 | +information required for processing the credit transfers. |
| 183 | + |
| 184 | +- **pain.001.001.09** - Customer Credit Transfer Initiation |
| 185 | + |
| 186 | +This message format is part of the ISO 20022 standard and is commonly used for |
| 187 | +SEPA Credit Transfers within the Single Euro Payments Area. It enables the |
| 188 | +transmission of credit transfer instructions from the originator to the |
| 189 | +originator's bank. The message includes essential information such as the |
| 190 | +originator's and beneficiary's details, payment amounts, payment references, |
| 191 | +and other transaction-related information required for processing the credit |
| 192 | +transfers. |
| 193 | + |
| 194 | +More message types will be added in the future. Please refer to the section |
| 195 | +below for more details. |
93 | 196 |
|
94 | 197 | ### Supported messages
|
95 | 198 |
|
96 | 199 | This section gives access to the documentation related to the ISO 20022
|
97 |
| -message definitions supported by `Pain001`. |
| 200 | +message definitions supported by **Pain001**. |
98 | 201 |
|
99 | 202 | #### Bank-to-Customer Cash Management
|
100 | 203 |
|
@@ -143,98 +246,17 @@ and monitor payments.
|
143 | 246 | | ⏳ | [pain.001.001.10][pain.001.001.10] | Customer Account Closure Request |
|
144 | 247 | | ⏳ | [pain.001.001.11][pain.001.001.11] | Customer Account Change Request |
|
145 | 248 |
|
146 |
| -## Getting Started 🚀 |
147 |
| - |
148 |
| -It takes just a few seconds to get up and running with `Pain001`. |
149 |
| - |
150 |
| -### Installation |
151 |
| - |
152 |
| -To install Pain001, run `pip install pain001` |
153 |
| - |
154 |
| -### Documentation |
155 |
| - |
156 |
| -> ℹ️ **Info:** Do check out our [website][0] for more information. |
157 |
| -
|
158 |
| -## Usage 📖 |
159 |
| - |
160 |
| -`Pain001` can be used in two ways: |
161 |
| - |
162 |
| -### Command Line Interface (CLI) |
163 |
| - |
164 |
| -After installation, you can run `pain001` directly from the command |
165 |
| -line. Simply call the main function with the path of your XML template |
166 |
| -file, XSD schema file and the path of your CSV file containing the |
167 |
| -payment data. |
168 |
| - |
169 |
| -#### Example pain.001.001.03 |
170 |
| - |
171 |
| -```bash |
172 |
| -python3 -m \pain001 "pain.001.001.03" \ |
173 |
| - ./templates/pain.001.001.03/template.xml \ |
174 |
| - ./templates/pain.001.001.03/pain.001.001.03.xsd \ |
175 |
| - ./templates/pain.001.001.03/template.csv |
176 |
| - |
177 |
| -``` |
178 |
| - |
179 |
| -#### Example pain.001.001.09 |
180 |
| - |
181 |
| -```bash |
182 |
| -python3 -m \pain001 "pain.001.001.09" \ |
183 |
| - ./templates/pain.001.001.09/template.xml \ |
184 |
| - ./templates/pain.001.001.09/pain.001.001.09.xsd \ |
185 |
| - ./templates/pain.001.001.09/template.csv |
186 |
| - |
187 |
| -``` |
188 |
| - |
189 |
| -### Embedded in an Application |
190 |
| - |
191 |
| -To embed Pain001 in a new or existing application, import the main |
192 |
| -function and use it in your code. |
193 |
| - |
194 |
| -Here's an example: |
195 |
| - |
196 |
| -```python |
197 |
| -from pain001 import main |
198 |
| - |
199 |
| -if __name__ == '__main__': |
200 |
| - xml_message_type = 'pain.001.001.03' |
201 |
| - xml_file_path = 'template.xml' |
202 |
| - xsd_file_path = 'schema.xsd' |
203 |
| - csv_file_path = 'data.csv' |
204 |
| - main(xml_file_path, xsd_file_path, csv_file_path) |
205 |
| -``` |
206 |
| - |
207 |
| -### Validation |
208 |
| - |
209 |
| -To validate the generated XML file against a given xsd schema, use the |
210 |
| -following method: |
211 |
| - |
212 |
| -```python |
213 |
| -from pain001.core import validate_xml_against_xsd |
214 |
| - |
215 |
| -xml_message_type = 'pain.001.001.03' |
216 |
| -xml_file = 'generated.xml' |
217 |
| -xsd_file = 'schema.xsd' |
218 |
| - |
219 |
| -is_valid = validate_xml_against_xsd( |
220 |
| - xml_message_type, |
221 |
| - xml_file, |
222 |
| - xsd_file |
223 |
| -) |
224 |
| -print(f"XML validation result: {is_valid}") |
225 |
| -``` |
226 |
| - |
227 | 249 | ## License 📝
|
228 | 250 |
|
229 | 251 | The project is licensed under the terms of both the MIT license and the
|
230 | 252 | Apache License (Version 2.0).
|
231 | 253 |
|
232 |
| -* [Apache License, Version 2.0][1] |
233 |
| -* [MIT license][2] |
| 254 | +- [Apache License, Version 2.0][1] |
| 255 | +- [MIT license][2] |
234 | 256 |
|
235 | 257 | ## Contribution 🤝
|
236 | 258 |
|
237 |
| -We welcome contributions to `Pain001`. Please see the |
| 259 | +We welcome contributions to **Pain001**. Please see the |
238 | 260 | [contributing instructions][4] for more information.
|
239 | 261 |
|
240 | 262 | Unless you explicitly state otherwise, any contribution intentionally
|
@@ -281,4 +303,3 @@ of [Pain001][5] for their help and support.
|
281 | 303 | [codecov-badge]: https://img.shields.io/codecov/c/github/sebastienrousseau/pain001?style=for-the-badge&token=AaUxKfRiou 'Codecov badge'
|
282 | 304 | [license-badge]: https://img.shields.io/pypi/l/pain001?style=for-the-badge 'License badge'
|
283 | 305 | [pypi-badge]: https://img.shields.io/pypi/pyversions/pain001.svg?style=for-the-badge 'PyPI badge'
|
284 |
| -[supported-messages]: #supported-messages 'Supported messages' |
|
0 commit comments