Skip to content

Commit 0904874

Browse files
Merge pull request #40 from sebastienrousseau/feat/pain001
feat(pain001):v0.0.24
2 parents 4f4ff43 + f2215d9 commit 0904874

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4399
-194
lines changed

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,13 @@ celerybeat-schedule
8484

8585
# virtualenv
8686
.venv
87+
.pain001/
88+
.pytest_cache/
8789
bandit-env
8890
myenv
8991
venv/
9092
ENV/
93+
pyvenv.cfg
9194

9295
# Spyder project settings
9396
.spyderproject
@@ -114,3 +117,13 @@ ENV/
114117
# Database
115118
*.db-shm
116119
*.db-wal
120+
pain001/bin/activate
121+
pain001/bin/activate.csh
122+
pain001/bin/activate.fish
123+
pain001/bin/Activate.ps1
124+
pain001/bin/pip
125+
pain001/bin/pip3
126+
pain001/bin/pip3.11
127+
pain001/bin/python
128+
pain001/bin/python3
129+
pain001/bin/python3.11

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020

2121
dist:
2222
rm -rf ./dist && \
23-
python3 setup.py sdist bdist_wheel
23+
python setup.py sdist bdist_wheel
2424

2525
release: dist
2626
bzr diff && \
2727
twine upload dist/* && \
28-
bzr tag $$(python3 setup.py --version|tail -1) && \
28+
bzr tag $$(python setup.py --version|tail -1) && \
2929
bzr push

README.md

+87-68
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,34 @@
44

55
## A Powerful Python Library that enables you to create ISO 20022-Compliant Payment Files directly from CSV or SQLite data files
66

7-
[![PyPI][pypi-badge]][3] [![PyPI Downloads][pypi-downloads-badge]][7] [![License][license-badge]][1] [![Codecov][codecov-badge]][6]
7+
[![PyPI][pypi-badge]][03] [![PyPI Downloads][pypi-downloads-badge]][07] [![License][license-badge]][01] [![Codecov][codecov-badge]][06]
88

99
## Overview
1010

11-
12-
**Pain001** is an open-source Python Library that you can use to create
13-
**ISO 20022-Compliant Payment Files** directly from your **CSV** or **SQLite**
14-
Data Files.
11+
**Pain001** is an open-source Python Library that you can use to create **ISO 20022-Compliant Payment Files** directly from your **CSV** or **SQLite** Data Files.
1512

1613
- **Website:** <https://pain001.com>
1714
- **Source code:** <https://github.com/sebastienrousseau/pain001>
1815
- **Bug reports:** <https://github.com/sebastienrousseau/pain001/issues>
1916

20-
The Python library focuses specifically on
21-
**Payment Initiation and Advice Messages**, commonly known as **Pain**. In a
22-
very simplified way, a **pain.001** is a message that initiates the customer
23-
payment.
17+
The Python library focuses specifically on **Payment Initiation and Advice Messages**, commonly known as **Pain**. In a very simplified way, a **pain.001** is a message that initiates the customer payment.
2418

2519
As of today the library is designed to be compatible with the:
2620

27-
- **Payments Initiation V03 (pain.001.001.03)** - ISO20022 message format for
28-
initiating payments with version 03,
29-
- **Payments Initiation V04 (pain.001.001.04)** - ISO20022 message format for
30-
initiating payments with version 04,
31-
- **Payments Initiation V05 (pain.001.001.05)** - ISO20022 message format for
32-
initiating payments with version 05 and,
33-
- **Payments Initiation V09 (pain.001.001.09)** - ISO20022 message format for
34-
initiating payments with version 09.
35-
36-
message types and will support more in the future.
37-
38-
Payments usually start with a **pain.001 payment initiation message**. The
39-
payer sends it to the payee (or the payee’s bank) via a secure network. This
40-
network could be **SWIFT** or **SEPA (Single Euro Payments Area) network**, or
41-
other payment networks such as **CHAPS**, **BACS**, **Faster Payments**, etc.
42-
The message contains the payer’s and payee’s bank account details, payment
43-
amount, and other information required to process the payment.
44-
45-
The **Pain001** library can reduce payment processing complexity and costs by
46-
generating ISO 20022-compliant payment files. These files automatically remove
47-
the need to create and validate them manually, making the payment process more
48-
efficient and cost-effective. It will save you time and resources and minimises
49-
the risk of errors, making sure accurate and seamless payment processing.
50-
51-
Use the **Pain001** library to simplify, accelerate and automate your payment
52-
processing.
21+
- **Payments Initiation V03 (pain.001.001.03)**: This version is used for initiating credit transfers within the SEPA (Single Euro Payments Area).
22+
- **Payments Initiation V04 (pain.001.001.04)**: Introduced support for non-SEPA payments and additional functionalities.
23+
- **Payments Initiation V05 (pain.001.001.05)**: Brought further enhancements and clarifications.
24+
- **Payments Initiation V06 (pain.001.001.06)**: Focused on introducing support for instant payments.
25+
- **Payments Initiation V07 (pain.001.001.07)**: Added support for Request for Large Payment (RLP) and Request to Modify Payment (RTP) functionalities.
26+
- **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.
27+
- **Payments Initiation V09 (pain.001.001.09)**: The latest version, which introduced support for Request for Account Information (RAI) functionality.
28+
29+
Payments usually start with a **pain.001 payment initiation message**. The payer sends it to the payee (or the payee’s bank) via a secure network. This
30+
network could be **SWIFT** or **SEPA (Single Euro Payments Area) network**, or other payment networks such as **CHAPS**, **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.
31+
32+
The **Pain001** library 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.
33+
34+
Use the **Pain001** library to simplify, accelerate and automate your payment processing.
5335

5436
## Table of Contents
5537

@@ -60,6 +42,10 @@ processing.
6042
- [Features](#features)
6143
- [Requirements](#requirements)
6244
- [Installation](#installation)
45+
- [Install `virtualenv`](#install-virtualenv)
46+
- [Create a Virtual Environment](#create-a-virtual-environment)
47+
- [Activate environment](#activate-environment)
48+
- [Getting Started](#getting-started)
6349
- [Quick Start](#quick-start)
6450
- [Arguments](#arguments)
6551
- [Examples](#examples)
@@ -113,33 +99,58 @@ processing.
11399

114100
## Requirements
115101

116-
**Pain001** works with macOS, Linux and Windows and requires Python 3.9.0 and
117-
above.
102+
**Pain001** works with macOS, Linux and Windows and requires Python 3.9.0 and above.
118103

119104
## Installation
120105

121-
It takes just a few seconds to get up and running with **Pain001**. You can
122-
install Pain001 from PyPI with pip or your favourite package manager:
106+
We recommend creating a virtual environment to install **Pain001**. This will ensure that the package is installed in an isolated environment and will not affect other projects. To install **Pain001** in a virtual environment, follow these steps:
107+
108+
### Install `virtualenv`
109+
110+
```sh
111+
python -m pip install virtualenv
112+
```
113+
114+
### Create a Virtual Environment
115+
116+
```sh
117+
python -m venv venv
118+
```
119+
120+
| Code | Explanation |
121+
|---|---|
122+
| `-m` | executes module `venv` |
123+
| `env` | name of the virtual environment |
124+
125+
### Activate environment
123126

124-
Open your terminal and run the following command:
127+
```sh
128+
source venv/bin/activate
129+
```
130+
131+
### Getting Started
132+
133+
It takes just a few seconds to get up and running with **Pain001**. You can install Pain001 from PyPI with pip or your favourite package manager:
134+
135+
Open your terminal and run the following command to add the latest version:
125136

126137
```sh
127-
pip install pain001
138+
python -m pip install pain001
128139
```
129140

130-
Add the -U switch to update to the current version, if `pain001` is already
131-
installed.
141+
Add the -U switch to update to the current version, if `pain001` is already installed.
142+
143+
```sh
144+
python -m pip install -U pain001
145+
```
132146

133147
## Quick Start
134148

135-
After installation, you can run **Pain001** directly from the command line.
136-
Simply call the main module pain001 with the paths of your:
149+
After installation, you can run **Pain001** directly from the command line. Simply call the main module pain001 with the paths of your:
137150

138-
- **XML template file** containing the various parameters you want to pass from
139-
your Data file,
151+
- **XML template file** containing the various parameters you want to pass from your Data file,
140152
- **XSD schema file** to validate the generated XML file, and
141-
- **Data file (CSV or SQLite)** containing the payment instructions that you
142-
want to submit.
153+
- **Data file (CSV or SQLite)** containing the payment instructions that you want to submit.
143154

144155
Here’s how you would do that:
145156

@@ -158,15 +169,22 @@ When running **Pain001**, you will need to specify four arguments:
158169
- An `xml_message_type`: This is the type of XML message you want to generate.
159170

160171
The currently supported types are:
172+
161173
- pain.001.001.03
162174
- pain.001.001.04
163175
- pain.001.001.05
176+
- pain.001.001.06
177+
- pain.001.001.07
178+
- pain.001.001.08
164179
- pain.001.001.09
180+
165181
- An `xml_template_file_path`: This is the path to the XML template file you
166182
are using that contains variables that will be replaced by the values in your
167183
Data file.
184+
168185
- An `xsd_schema_file_path`: This is the path to the XSD schema file you are
169186
using to validate the generated XML file.
187+
170188
- A `data_file_path`: This is the path to the CSV or SQLite Data file you want
171189
to convert to XML format.
172190

@@ -205,9 +223,7 @@ GitHub:
205223
git clone https://github.com/sebastienrousseau/pain001.git
206224
```
207225

208-
Then, navigate to the `pain001` directory and run the following command:
209-
210-
```sh
226+
```sh
211227
python -m pain001 \
212228
-t pain.001.001.03 \
213229
-m templates/pain.001.001.03/template.xml \
@@ -277,7 +293,7 @@ print(f"XML validation result: {is_valid}")
277293

278294
## Documentation
279295

280-
> **Info:** Do check out our [website][0] for comprehensive documentation.
296+
> **Info:** Do check out our [website][00] for comprehensive documentation.
281297
282298
### Supported messages
283299

@@ -324,9 +340,9 @@ and monitor payments.
324340
|| [pain.001.001.03][pain.001.001.03] | Customer Credit Transfer Initiation |
325341
|| [pain.001.001.04][pain.001.001.04] | Customer Direct Debit Initiation |
326342
|| [pain.001.001.05][pain.001.001.05] | Customer Direct Debit Reversal |
327-
| | pain.001.001.06 | Customer Credit Transfer Reversal |
328-
| | pain.001.001.07 | Customer Account Notification |
329-
| | pain.001.001.08 | Customer Account Statement |
343+
| | [pain.001.001.06][pain.001.001.06] | Customer Credit Transfer Reversal |
344+
| | [pain.001.001.07][pain.001.001.07] | Customer Account Notification |
345+
| | [pain.001.001.08][pain.001.001.08] | Customer Account Statement |
330346
|| [pain.001.001.09][pain.001.001.09] | Customer Credit Transfer Initiation |
331347
|| pain.001.001.10 | Customer Account Closure Request |
332348
|| pain.001.001.11 | Customer Account Change Request |
@@ -336,13 +352,13 @@ and monitor payments.
336352
The project is licensed under the terms of both the MIT license and the
337353
Apache License (Version 2.0).
338354

339-
- [Apache License, Version 2.0][1]
340-
- [MIT license][2]
355+
- [Apache License, Version 2.0][01]
356+
- [MIT license][02]
341357

342358
## Contribution
343359

344360
We welcome contributions to **Pain001**. Please see the
345-
[contributing instructions][4] for more information.
361+
[contributing instructions][04] for more information.
346362

347363
Unless you explicitly state otherwise, any contribution intentionally
348364
submitted for inclusion in the work by you, as defined in the
@@ -352,20 +368,23 @@ additional terms or conditions.
352368
## Acknowledgements
353369

354370
We would like to extend a big thank you to all the awesome contributors
355-
of [Pain001][5] for their help and support.
371+
of [Pain001][05] for their help and support.
356372

357-
[0]: https://pain001.com
358-
[1]: https://opensource.org/license/apache-2-0/
359-
[2]: http://opensource.org/licenses/MIT
360-
[3]: https://github.com/sebastienrousseau/pain001
361-
[4]: https://github.com/sebastienrousseau/pain001/blob/main/CONTRIBUTING.md
362-
[5]: https://github.com/sebastienrousseau/pain001/graphs/contributors
363-
[6]: https://codecov.io/github/sebastienrousseau/pain001?branch=main
364-
[7]: https://pypi.org/project/pain001/
373+
[00]: https://pain001.com
374+
[01]: https://opensource.org/license/apache-2-0/
375+
[02]: http://opensource.org/licenses/MIT
376+
[03]: https://github.com/sebastienrousseau/pain001
377+
[04]: https://github.com/sebastienrousseau/pain001/blob/main/CONTRIBUTING.md
378+
[05]: https://github.com/sebastienrousseau/pain001/graphs/contributors
379+
[06]: https://codecov.io/github/sebastienrousseau/pain001?branch=main
380+
[07]: https://pypi.org/project/pain001/
365381

366382
[pain.001.001.03]: https://pain001.com/pain.001.001.03/index.html
367383
[pain.001.001.04]: https://pain001.com/pain.001.001.04/index.html
368384
[pain.001.001.05]: https://pain001.com/pain.001.001.05/index.html
385+
[pain.001.001.06]: https://pain001.com/pain.001.001.06/index.html
386+
[pain.001.001.07]: https://pain001.com/pain.001.001.07/index.html
387+
[pain.001.001.08]: https://pain001.com/pain.001.001.08/index.html
369388
[pain.001.001.09]: https://pain001.com/pain.001.001.09/index.html
370389

371390
[banner]: https://kura.pro/pain001/images/banners/banner-pain001.svg 'Pain001, A Python Library for Automating ISO 20022-Compliant Payment Files Using CSV Or SQlite Data Files.'

TEMPLATE.md

+37-6
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,47 @@ above.
1919

2020
## Installation
2121

22-
It takes just a few seconds to get up and running with **Pain001**. You can
23-
install Pain001 from PyPI with pip or your favourite package manager:
22+
We recommend creating a virtual environment to install **Pain001**. This will ensure that the package is installed in an isolated environment and will not affect other projects. To install **Pain001** in a virtual environment, follow these steps:
2423

25-
Open your terminal and run the following command:
24+
### Install `virtualenv`
2625

2726
```sh
28-
pip install pain001
27+
python -m pip install virtualenv
2928
```
3029

31-
Add the -U switch to update to the current version, if `pain001` is already
32-
installed.
30+
### Create a Virtual Environment
31+
32+
```sh
33+
python -m venv venv
34+
```
35+
36+
| Code | Explanation |
37+
|---|---|
38+
| `-m` | executes module `venv` |
39+
| `env` | name of the virtual environment |
40+
41+
### Activate environment
42+
43+
```sh
44+
source venv/bin/activate
45+
```
46+
47+
### Getting Started
48+
49+
It takes just a few seconds to get up and running with **Pain001**. You can install Pain001 from PyPI with pip or your favourite package manager:
50+
51+
Open your terminal and run the following command to add the latest version:
52+
53+
```sh
54+
python -m pip install pain001
55+
```
56+
57+
Add the -U switch to update to the current version, if `pain001` is already installed.
58+
59+
```sh
60+
python -m pip install -U pain001
61+
```
3362

3463
[banner]: https://kura.pro/pain001/images/banners/banner-pain001.svg 'Pain001, A Python Library for Automating ISO 20022-Compliant Payment Files Using CSV Or SQlite Data Files.'
64+
65+
## Changelog

pain001/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
# limitations under the License.
1515

1616
"""The Python pain001 module."""
17-
__version__ = "0.0.23"
17+
__version__ = "0.0.24"

pain001/constants/constants.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
# Defines the valid XML types for the ISO 20022 Payment Initiation
1717
# message types that are supported by the pain001 library.
1818
valid_xml_types = [
19-
"pain.001.001.03", # Customer Credit Transfer Initiation
20-
"pain.001.001.04", # Customer Direct Debit Initiation
21-
"pain.001.001.05", # Request for Payment Status
22-
"pain.001.001.06", # Notification of Payment Status
23-
"pain.001.001.07", # Request for Reversal
24-
"pain.001.001.08", # Notification of Reversal
25-
"pain.001.001.09", # Request for Amendment
26-
"pain.001.001.10" # Notification of Amendment
27-
"pain.001.001.11", # Request for Cancellation
19+
"pain.001.001.03", # Customer Credit Transfer Initiation (pain.001.001.03)
20+
"pain.001.001.04", # Customer Direct Debit Initiation (pain.001.001.04)
21+
"pain.001.001.05", # Request for Payment Status (pain.001.001.05)
22+
"pain.001.001.06", # Notification of Payment Status (pain.001.001.06)
23+
"pain.001.001.07", # Request for Reversal (pain.001.001.07)
24+
"pain.001.001.08", # Notification of Reversal (pain.001.001.08)
25+
"pain.001.001.09", # Request for Amendment (pain.001.001.09)
26+
"pain.001.001.10" # Notification of Amendment (pain.001.001.10)
27+
"pain.001.001.11", # Request for Cancellation (pain.001.001.11)
2828
]

pain001/core/core.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def process_files(
4141
4242
Args:
4343
xml_message_type (str): The type of XML message to generate. Valid
44-
options are 'pain.001.001.03' and 'pain.001.001.09'.
44+
options are 'pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05',
45+
'pain.001.001.06' and 'pain.001.001.09'.
4546
xml_template_file_path (str): The path of the XML template file.
4647
xsd_schema_file_path (str): The path of the XSD schema file.
4748
data_file_path (str): The path of the CSV or SQLite file containing the

0 commit comments

Comments
 (0)