Skip to content

Commit 9b73d13

Browse files
Merge pull request #27 from sebastienrousseau/feat/pain001
Feat/pain001
2 parents e0c6515 + 594589a commit 9b73d13

18 files changed

+310
-6
lines changed

TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

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

13-
# Pain001 (v0.0.14)
13+
# Pain001 (v0.0.15)
1414

1515
![Pain001 banner][banner]
1616

docs/README.md

+284
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
<!-- markdownlint-disable MD033 MD041 -->
2+
3+
<img
4+
src="https://kura.pro/pain001/images/logos/pain001.svg"
5+
alt="Pain001 logo"
6+
height="261"
7+
width="261"
8+
align="right"
9+
/>
10+
11+
<!-- markdownlint-enable MD033 MD041 -->
12+
13+
# Python Pain001
14+
15+
![Pain001 banner][banner]
16+
17+
[![PyPI][pypi-badge]][3] [![License][license-badge]][1]
18+
[![Codecov][codecov-badge]][6]
19+
20+
## Overview 📖
21+
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.
25+
26+
With `Pain001`, you can easily create payment transactions files in just
27+
a few simple steps.
28+
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.
32+
33+
## ISO 20022 Payment Initiation Message Types 📨
34+
35+
The following **ISO 20022 Payment Initiation message types** are
36+
currently supported:
37+
38+
* **pain.001.001.03** - Customer Credit Transfer Initiation
39+
40+
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.
93+
94+
### Supported messages
95+
96+
This section gives access to the documentation related to the ISO 20022
97+
message definitions supported by `Pain001`.
98+
99+
#### Bank-to-Customer Cash Management
100+
101+
Set of messages used to request and provide account information for
102+
reconciliation and cash positioning between an account servicer and its
103+
customer.
104+
105+
| Status | Message type | Name |
106+
|---|---|---|
107+
|| [camt.052.001.10] | Bank-to-Customer Account Statement |
108+
|| [camt.060.001.10] | Customer Account Notification |
109+
|| [camt.054.001.10] | Customer Account Statement Request |
110+
|| [camt.053.001.10] | Customer Account Identification |
111+
112+
#### Payments Clearing and Settlement
113+
114+
Set of messages used between financial institutions for the clearing and
115+
settlement of payment transactions.
116+
117+
| Status | Message type | Name |
118+
|---|---|---|
119+
|| [pacs.002.001.12] | Credit Transfer Notification |
120+
|| [pacs.003.001.09] | Direct Debit Initiation |
121+
|| [pacs.004.001.11] | Direct Debit Reversal |
122+
|| [pacs.007.001.11] | Customer Direct Debit Confirmation |
123+
|| [pacs.008.001.10] | Credit Transfer Initiation |
124+
|| [pacs.009.001.10] | Credit Transfer Reversal |
125+
|| [pacs.010.001.05] | Account Identification |
126+
|| [pacs.028.001.05] | Account Statement Request |
127+
128+
#### Payments Initiation
129+
130+
Set of messages exchanged between a debtor (or buyer) and its bank or
131+
between a creditor (or seller) and its bank to initiate, collect, manage
132+
and monitor payments.
133+
134+
| Status | Message type | Name |
135+
|---|---|---|
136+
|| [pain.001.001.03][pain.001.001.03] | Customer Credit Transfer Initiation |
137+
|| [pain.001.001.04][pain.001.001.04] | Customer Direct Debit Initiation |
138+
|| [pain.001.001.05][pain.001.001.05] | Customer Direct Debit Reversal |
139+
|| [pain.001.001.06][pain.001.001.06] | Customer Credit Transfer Reversal |
140+
|| [pain.001.001.07][pain.001.001.07] | Customer Account Notification |
141+
|| [pain.001.001.08][pain.001.001.08] | Customer Account Statement |
142+
|| [pain.001.001.09][pain.001.001.09] | Customer Credit Transfer Initiation |
143+
|| [pain.001.001.10][pain.001.001.10] | Customer Account Closure Request |
144+
|| [pain.001.001.11][pain.001.001.11] | Customer Account Change Request |
145+
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+
## License 📝
228+
229+
The project is licensed under the terms of both the MIT license and the
230+
Apache License (Version 2.0).
231+
232+
* [Apache License, Version 2.0][1]
233+
* [MIT license][2]
234+
235+
## Contribution 🤝
236+
237+
We welcome contributions to `Pain001`. Please see the
238+
[contributing instructions][4] for more information.
239+
240+
Unless you explicitly state otherwise, any contribution intentionally
241+
submitted for inclusion in the work by you, as defined in the
242+
Apache-2.0 license, shall be dual licensed as above, without any
243+
additional terms or conditions.
244+
245+
## Acknowledgements 💙
246+
247+
We would like to extend a big thank you to all the awesome contributors
248+
of [Pain001][5] for their help and support.
249+
250+
[0]: https://Pain001.co
251+
[1]: https://opensource.org/license/apache-2-0/
252+
[2]: http://opensource.org/licenses/MIT
253+
[3]: https://github.com/sebastienrousseau/pain001
254+
[4]: https://github.com/sebastienrousseau/pain001/blob/main/CONTRIBUTING.md
255+
[5]: https://github.com/sebastienrousseau/pain001/graphs/contributors
256+
[6]: https://codecov.io/github/sebastienrousseau/pain001?branch=main
257+
258+
[camt.052.001.10]: bank-to-customer-cash-management/messages/camt.052.001.10/README.md
259+
[camt.060.001.10]: bank-to-customer-cash-management/messages/camt.053.001.10/README.md
260+
[camt.054.001.10]: bank-to-customer-cash-management/messages/camt.054.001.10/README.md
261+
[camt.053.001.10]: bank-to-customer-cash-management/messages/camt.053.001.10/README.md
262+
[pacs.002.001.12]: payments-clearing-and-settlement/messages/pacs.002.001.12/README.md
263+
[pacs.003.001.09]: payments-clearing-and-settlement/messages/pacs.003.001.09/README.md
264+
[pacs.004.001.11]: payments-clearing-and-settlement/messages/pacs.004.001.11/README.md
265+
[pacs.007.001.11]: payments-clearing-and-settlement/messages/pacs.007.001.11/README.md
266+
[pacs.008.001.10]: payments-clearing-and-settlement/messages/pacs.008.001.10/README.md
267+
[pacs.009.001.10]: payments-clearing-and-settlement/messages/pacs.009.001.10/README.md
268+
[pacs.010.001.05]: payments-clearing-and-settlement/messages/pacs.010.001.05/README.md
269+
[pacs.028.001.05]: payments-clearing-and-settlement/messages/pacs.028.001.05/README.md
270+
[pain.001.001.03]: payments-initiation/messages/pain.001.001.03/README.md
271+
[pain.001.001.04]: payments-initiation/messages/pain.001.001.04/README.md
272+
[pain.001.001.05]: payments-initiation/messages/pain.001.001.05/README.md
273+
[pain.001.001.06]: payments-initiation/messages/pain.001.001.06/README.md
274+
[pain.001.001.07]: payments-initiation/messages/pain.001.001.07/README.md
275+
[pain.001.001.08]: payments-initiation/messages/pain.001.001.08/README.md
276+
[pain.001.001.09]: payments-initiation/messages/pain.001.001.09/README.md
277+
[pain.001.001.10]: payments-initiation/messages/pain.001.001.10/README.md
278+
[pain.001.001.11]: payments-initiation/messages/pain.001.001.11/README.md
279+
280+
[banner]: https://kura.pro/pain001/images/titles/title-pain001.svg 'Pain001'
281+
[codecov-badge]: https://img.shields.io/codecov/c/github/sebastienrousseau/pain001?style=for-the-badge&token=AaUxKfRiou 'Codecov badge'
282+
[license-badge]: https://img.shields.io/pypi/l/pain001?style=for-the-badge 'License badge'
283+
[pypi-badge]: https://img.shields.io/pypi/pyversions/pain001.svg?style=for-the-badge 'PyPI badge'
284+
[supported-messages]: #supported-messages 'Supported messages'

pain001/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515

1616
"""The Python pain001 module."""
1717
__all__ = ["pain001"]
18-
__version__ = "0.0.14"
18+
__version__ = "0.0.15"

pain001/__main__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
their code.
2424
"""
2525

26-
from .core import process_files
26+
from pain001.core import process_files
2727
from pain001.context import context
2828
from pain001.constants.constants import valid_xml_types
2929

pyproject.toml

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
[tool.poetry]
22
name = "pain001"
3-
version = "0.0.14"
3+
version = "0.0.15"
44
description = "pain001 is a Python library that makes it easy to automate the creation of ISO20022-compliant payment files directly from a CSV file."
55
authors = ["Sebastien Rousseau <[email protected]>"]
66
license = "Apache Software License"
77
readme = "README.md"
8+
repository = "https://github.com/sebastienrousseau/pain001"
9+
homepage = "https://pain001.com"
810

911
[tool.poetry.dependencies]
1012
python = "^3.9"
@@ -13,3 +15,21 @@ xmlschema = "^1.8.0"
1315
[build-system]
1416
requires = ["poetry-core"]
1517
build-backend = "poetry.core.masonry.api"
18+
19+
[tool.black]
20+
line-length = 72
21+
target-version = ['py39']
22+
23+
[tool.isort]
24+
profile = "black"
25+
line_length = 72
26+
multi_line_output = 3
27+
include_trailing_comma = true
28+
force_grid_wrap = 0
29+
combine_as_imports = true
30+
known_first_party = "pain001"
31+
known_third_party = "xmlschema"
32+
33+
[tool.pytest]
34+
addopts = "--cov=pain001 --cov-report=term-missing --cov-report=xml --cov-report=html --cov-fail-under=100"
35+
testpaths = "tests"

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pain001
3-
version = 0.0.14
3+
version = 0.0.15
44
author = Sebastian Rousseau
55
author_email = [email protected]
66
description = pain001 is a Python library that makes it easy to automate the creation of ISO20022-compliant payment files directly from a CSV file.

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
'xmlschema>=1.8.0',
7171
]
7272

73-
VERSION = '0.0.14'
73+
VERSION = '0.0.15'
7474
URL = 'https://github.com/sebastienrousseau/pain001'
7575

7676
setup(

0 commit comments

Comments
 (0)