Skip to content

Commit

Permalink
Merge pull request #40 from sebastienrousseau/feat/pain001
Browse files Browse the repository at this point in the history
feat(pain001):v0.0.24
  • Loading branch information
sebastienrousseau authored Nov 19, 2023
2 parents 4f4ff43 + f2215d9 commit 0904874
Show file tree
Hide file tree
Showing 49 changed files with 4,399 additions and 194 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ celerybeat-schedule

# virtualenv
.venv
.pain001/
.pytest_cache/
bandit-env
myenv
venv/
ENV/
pyvenv.cfg

# Spyder project settings
.spyderproject
Expand All @@ -114,3 +117,13 @@ ENV/
# Database
*.db-shm
*.db-wal
pain001/bin/activate
pain001/bin/activate.csh
pain001/bin/activate.fish
pain001/bin/Activate.ps1
pain001/bin/pip
pain001/bin/pip3
pain001/bin/pip3.11
pain001/bin/python
pain001/bin/python3
pain001/bin/python3.11
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

dist:
rm -rf ./dist && \
python3 setup.py sdist bdist_wheel
python setup.py sdist bdist_wheel

release: dist
bzr diff && \
twine upload dist/* && \
bzr tag $$(python3 setup.py --version|tail -1) && \
bzr tag $$(python setup.py --version|tail -1) && \
bzr push
155 changes: 87 additions & 68 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,34 @@

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

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

## Overview


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

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

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

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

- **Payments Initiation V03 (pain.001.001.03)** - ISO20022 message format for
initiating payments with version 03,
- **Payments Initiation V04 (pain.001.001.04)** - ISO20022 message format for
initiating payments with version 04,
- **Payments Initiation V05 (pain.001.001.05)** - ISO20022 message format for
initiating payments with version 05 and,
- **Payments Initiation V09 (pain.001.001.09)** - ISO20022 message format for
initiating payments with version 09.

message types and will support more in the future.

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

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.

Use the **Pain001** library to simplify, accelerate and automate your payment
processing.
- **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 a **pain.001 payment initiation message**. The payer sends it to the payee (or the payee’s bank) via a secure network. This
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.

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.

Use the **Pain001** library to simplify, accelerate and automate your payment processing.

## Table of Contents

Expand All @@ -60,6 +42,10 @@ processing.
- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Install `virtualenv`](#install-virtualenv)
- [Create a Virtual Environment](#create-a-virtual-environment)
- [Activate environment](#activate-environment)
- [Getting Started](#getting-started)
- [Quick Start](#quick-start)
- [Arguments](#arguments)
- [Examples](#examples)
Expand Down Expand Up @@ -113,33 +99,58 @@ processing.

## Requirements

**Pain001** works with macOS, Linux and Windows and requires Python 3.9.0 and
above.
**Pain001** works with macOS, Linux and Windows and requires Python 3.9.0 and above.

## Installation

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:
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:

### Install `virtualenv`

```sh
python -m pip install virtualenv
```

### Create a Virtual Environment

```sh
python -m venv venv
```

| Code | Explanation |
|---|---|
| `-m` | executes module `venv` |
| `env` | name of the virtual environment |

### Activate environment

Open your terminal and run the following command:
```sh
source venv/bin/activate
```

### Getting Started

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:

Open your terminal and run the following command to add the latest version:

```sh
pip install pain001
python -m pip install pain001
```

Add the -U switch to update to the current version, if `pain001` is already
installed.
Add the -U switch to update to the current version, if `pain001` is already installed.

```sh
python -m pip install -U pain001
```

## Quick Start

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

- **XML template file** containing the various parameters you want to pass from
your Data file,
- **XML template file** containing the various parameters you want to pass from your Data file,
- **XSD schema file** to validate the generated XML file, and
- **Data file (CSV or SQLite)** containing the payment instructions that you
want to submit.
- **Data file (CSV or SQLite)** containing the payment instructions that you want to submit.

Here’s how you would do that:

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

The currently supported types are:

- pain.001.001.03
- pain.001.001.04
- pain.001.001.05
- pain.001.001.06
- pain.001.001.07
- pain.001.001.08
- pain.001.001.09

- An `xml_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.

- An `xsd_schema_file_path`: This is the path to the XSD schema file you are
using to validate the generated XML file.

- A `data_file_path`: This is the path to the CSV or SQLite Data file you want
to convert to XML format.

Expand Down Expand Up @@ -205,9 +223,7 @@ GitHub:
git clone https://github.com/sebastienrousseau/pain001.git
```

Then, navigate to the `pain001` directory and run the following command:

```sh
```sh
python -m pain001 \
-t pain.001.001.03 \
-m templates/pain.001.001.03/template.xml \
Expand Down Expand Up @@ -277,7 +293,7 @@ print(f"XML validation result: {is_valid}")
## Documentation
> **Info:** Do check out our [website][0] for comprehensive documentation.
> **Info:** Do check out our [website][00] for comprehensive documentation.
### Supported messages
Expand Down Expand Up @@ -324,9 +340,9 @@ and monitor payments.
| ✅ | [pain.001.001.03][pain.001.001.03] | Customer Credit Transfer Initiation |
| ✅ | [pain.001.001.04][pain.001.001.04] | Customer Direct Debit Initiation |
| ✅ | [pain.001.001.05][pain.001.001.05] | Customer Direct Debit Reversal |
| | pain.001.001.06 | Customer Credit Transfer Reversal |
| | pain.001.001.07 | Customer Account Notification |
| | pain.001.001.08 | Customer Account Statement |
| | [pain.001.001.06][pain.001.001.06] | Customer Credit Transfer Reversal |
| | [pain.001.001.07][pain.001.001.07] | Customer Account Notification |
| | [pain.001.001.08][pain.001.001.08] | Customer Account Statement |
| ✅ | [pain.001.001.09][pain.001.001.09] | Customer Credit Transfer Initiation |
| ⏳ | pain.001.001.10 | Customer Account Closure Request |
| ⏳ | pain.001.001.11 | Customer Account Change Request |
Expand All @@ -336,13 +352,13 @@ and monitor payments.
The project is licensed under the terms of both the MIT license and the
Apache License (Version 2.0).
- [Apache License, Version 2.0][1]
- [MIT license][2]
- [Apache License, Version 2.0][01]
- [MIT license][02]
## Contribution
We welcome contributions to **Pain001**. Please see the
[contributing instructions][4] for more information.
[contributing instructions][04] for more information.
Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the
Expand All @@ -352,20 +368,23 @@ additional terms or conditions.
## Acknowledgements
We would like to extend a big thank you to all the awesome contributors
of [Pain001][5] for their help and support.
of [Pain001][05] for their help and support.
[0]: https://pain001.com
[1]: https://opensource.org/license/apache-2-0/
[2]: http://opensource.org/licenses/MIT
[3]: https://github.com/sebastienrousseau/pain001
[4]: https://github.com/sebastienrousseau/pain001/blob/main/CONTRIBUTING.md
[5]: https://github.com/sebastienrousseau/pain001/graphs/contributors
[6]: https://codecov.io/github/sebastienrousseau/pain001?branch=main
[7]: https://pypi.org/project/pain001/
[00]: https://pain001.com
[01]: https://opensource.org/license/apache-2-0/
[02]: http://opensource.org/licenses/MIT
[03]: https://github.com/sebastienrousseau/pain001
[04]: https://github.com/sebastienrousseau/pain001/blob/main/CONTRIBUTING.md
[05]: https://github.com/sebastienrousseau/pain001/graphs/contributors
[06]: https://codecov.io/github/sebastienrousseau/pain001?branch=main
[07]: https://pypi.org/project/pain001/
[pain.001.001.03]: https://pain001.com/pain.001.001.03/index.html
[pain.001.001.04]: https://pain001.com/pain.001.001.04/index.html
[pain.001.001.05]: https://pain001.com/pain.001.001.05/index.html
[pain.001.001.06]: https://pain001.com/pain.001.001.06/index.html
[pain.001.001.07]: https://pain001.com/pain.001.001.07/index.html
[pain.001.001.08]: https://pain001.com/pain.001.001.08/index.html
[pain.001.001.09]: https://pain001.com/pain.001.001.09/index.html
[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.'
Expand Down
43 changes: 37 additions & 6 deletions TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,47 @@ above.

## Installation

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:
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:

Open your terminal and run the following command:
### Install `virtualenv`

```sh
pip install pain001
python -m pip install virtualenv
```

Add the -U switch to update to the current version, if `pain001` is already
installed.
### Create a Virtual Environment

```sh
python -m venv venv
```

| Code | Explanation |
|---|---|
| `-m` | executes module `venv` |
| `env` | name of the virtual environment |

### Activate environment

```sh
source venv/bin/activate
```

### Getting Started

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:

Open your terminal and run the following command to add the latest version:

```sh
python -m pip install pain001
```

Add the -U switch to update to the current version, if `pain001` is already installed.

```sh
python -m pip install -U pain001
```

[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.'

## Changelog
2 changes: 1 addition & 1 deletion pain001/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# limitations under the License.

"""The Python pain001 module."""
__version__ = "0.0.23"
__version__ = "0.0.24"
18 changes: 9 additions & 9 deletions pain001/constants/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
# Defines the valid XML types for the ISO 20022 Payment Initiation
# message types that are supported by the pain001 library.
valid_xml_types = [
"pain.001.001.03", # Customer Credit Transfer Initiation
"pain.001.001.04", # Customer Direct Debit Initiation
"pain.001.001.05", # Request for Payment Status
"pain.001.001.06", # Notification of Payment Status
"pain.001.001.07", # Request for Reversal
"pain.001.001.08", # Notification of Reversal
"pain.001.001.09", # Request for Amendment
"pain.001.001.10" # Notification of Amendment
"pain.001.001.11", # Request for Cancellation
"pain.001.001.03", # Customer Credit Transfer Initiation (pain.001.001.03)
"pain.001.001.04", # Customer Direct Debit Initiation (pain.001.001.04)
"pain.001.001.05", # Request for Payment Status (pain.001.001.05)
"pain.001.001.06", # Notification of Payment Status (pain.001.001.06)
"pain.001.001.07", # Request for Reversal (pain.001.001.07)
"pain.001.001.08", # Notification of Reversal (pain.001.001.08)
"pain.001.001.09", # Request for Amendment (pain.001.001.09)
"pain.001.001.10" # Notification of Amendment (pain.001.001.10)
"pain.001.001.11", # Request for Cancellation (pain.001.001.11)
]
3 changes: 2 additions & 1 deletion pain001/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def process_files(
Args:
xml_message_type (str): The type of XML message to generate. Valid
options are 'pain.001.001.03' and 'pain.001.001.09'.
options are 'pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05',
'pain.001.001.06' and 'pain.001.001.09'.
xml_template_file_path (str): The path of the XML template file.
xsd_schema_file_path (str): The path of the XSD schema file.
data_file_path (str): The path of the CSV or SQLite file containing the
Expand Down
Loading

0 comments on commit 0904874

Please sign in to comment.