Skip to content

Commit e3965df

Browse files
Merge pull request #30 from sebastienrousseau/feat/pain001
feat(pain001): v0.0.18
2 parents 065556a + c2e40d8 commit e3965df

13 files changed

+629
-253
lines changed

README.md

+172-151
Original file line numberDiff line numberDiff line change
@@ -2,99 +2,202 @@
22

33
<img
44
src="https://kura.pro/pain001/images/logos/pain001.svg"
5-
alt="Pain001 logo"
5+
alt="Pain001 Logo"
66
height="261"
77
width="261"
88
align="right"
99
/>
1010

1111
<!-- markdownlint-enable MD033 MD041 -->
1212

13-
# Python Pain001
13+
# Pain001 - A Python Library for Automating ISO 20022-Compliant Payment Files Using CSV Data
1414

1515
![Pain001 banner][banner]
1616

1717
[![PyPI][pypi-badge]][3] [![License][license-badge]][1]
1818
[![Codecov][codecov-badge]][6]
1919

20-
## Overview 📖
20+
**Pain001** is a Python Library for Automating ISO 20022-Compliant Payment
21+
Files Using CSV Data.
2122

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.
2529

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**.
2832

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+
```
32162

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
34168

35169
The following **ISO 20022 Payment Initiation message types** are
36170
currently supported:
37171

38-
* **pain.001.001.03** - Customer Credit Transfer Initiation
172+
- **pain.001.001.03** - Customer Credit Transfer Initiation
39173

40174
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.
93196

94197
### Supported messages
95198

96199
This section gives access to the documentation related to the ISO 20022
97-
message definitions supported by `Pain001`.
200+
message definitions supported by **Pain001**.
98201

99202
#### Bank-to-Customer Cash Management
100203

@@ -143,98 +246,17 @@ and monitor payments.
143246
|| [pain.001.001.10][pain.001.001.10] | Customer Account Closure Request |
144247
|| [pain.001.001.11][pain.001.001.11] | Customer Account Change Request |
145248

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-
227249
## License 📝
228250

229251
The project is licensed under the terms of both the MIT license and the
230252
Apache License (Version 2.0).
231253

232-
* [Apache License, Version 2.0][1]
233-
* [MIT license][2]
254+
- [Apache License, Version 2.0][1]
255+
- [MIT license][2]
234256

235257
## Contribution 🤝
236258

237-
We welcome contributions to `Pain001`. Please see the
259+
We welcome contributions to **Pain001**. Please see the
238260
[contributing instructions][4] for more information.
239261

240262
Unless you explicitly state otherwise, any contribution intentionally
@@ -281,4 +303,3 @@ of [Pain001][5] for their help and support.
281303
[codecov-badge]: https://img.shields.io/codecov/c/github/sebastienrousseau/pain001?style=for-the-badge&token=AaUxKfRiou 'Codecov badge'
282304
[license-badge]: https://img.shields.io/pypi/l/pain001?style=for-the-badge 'License badge'
283305
[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

Comments
 (0)