pain001


Namepain001 JSON
Version 0.0.25 PyPI version JSON
download
home_pagehttps://pain001.com
SummaryPain001, A Python Library for Automating ISO 20022-Compliant Payment Files Using CSV Or SQLite Data Files.
upload_time2024-05-19 20:50:46
maintainerNone
docs_urlNone
authorSebastien Rousseau
requires_python<3.13,>=3.9
licenseApache Software License
keywords pain001 iso20022 payment-processing automate-payments sepa financial banking-payments csv sqlite
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Pain001: Automate ISO 20022-Compliant Payment File Creation

![Pain001 banner][banner]

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

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

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

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

- **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 minimize
the risk of errors, ensuring accurate and seamless payment processing.

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

## Table of Contents

- [Pain001: Automate ISO 20022-Compliant Payment File Creation](#pain001-automate-iso-20022-compliant-payment-file-creation)
  - [A Powerful Python Library that enables you to create ISO 20022-Compliant Payment Files directly from CSV or SQLite data files](#a-powerful-python-library-that-enables-you-to-create-iso-20022-compliant-payment-files-directly-from-csv-or-sqlite-data-files)
  - [Overview](#overview)
  - [Table of Contents](#table-of-contents)
  - [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)
    - [Using a CSV Data File as the source](#using-a-csv-data-file-as-the-source)
    - [Using a SQLite Data File as the source](#using-a-sqlite-data-file-as-the-source)
    - [Using the Source code](#using-the-source-code)
      - [Pain.001.001.03](#pain00100103)
      - [Pain.001.001.04](#pain00100104)
      - [Pain.001.001.05](#pain00100105)
      - [Pain.001.001.06](#pain00100106)
      - [Pain.001.001.07](#pain00100107)
      - [Pain.001.001.08](#pain00100108)
      - [Pain.001.001.09](#pain00100109)
    - [Embedded in an Application](#embedded-in-an-application)
    - [Validation](#validation)
  - [Documentation](#documentation)
    - [Supported messages](#supported-messages)
      - [Bank-to-Customer Cash Management](#bank-to-customer-cash-management)
      - [Payments Clearing and Settlement](#payments-clearing-and-settlement)
      - [Payments Initiation](#payments-initiation)
  - [License](#license)
  - [Contribution](#contribution)
  - [Acknowledgements](#acknowledgements)

## Features

- **Easy to use:** Both developers and non-developers can easily use the
  library, as it requires minimal coding knowledge.
- **Open-source**: The library is open-source and free to use, making it
  accessible to everyone.
- **Secure**: The library is secure and does not store any sensitive data,
  ensuring that all information remains confidential.
- **Customizable**: The library allows developers to customize the output,
  making it adaptable to specific business requirements and preferences.
- **Scalable solution**: The **Pain001** library can handle varying volumes of
  payment files, making it suitable for businesses of different sizes and
  transaction volumes.
- **Time-saving**: The automated file creation process reduces the time spent on
  manual data entry and file generation, increasing overall productivity.
- **Seamless integration**: As a Python package, the Pain001 library is
  compatible with various Python-based applications and easily integrates into
  any existing projects or workflows.
- **Cross-border compatibility**: The library supports both Single Euro Payments
  Area (SEPA) and non-SEPA credit transfers, making it versatile for use in
  different countries and regions.
- **Improve accuracy** by providing precise data; the library reduces errors in
  payment file creation and processing.
- **Enhance efficiency** by automating the creation of Payment Initiation
  message files
- **Accelerate payment file creation** by automating the process and reducing
  the time required to create payment files.
- **Guarantee the highest quality and compliance** by validating all payment
  files to meet the ISO 20022 standards.
- **Simplify ISO 20022-compliant payment initiation message creation** by
  providing a standardized payment file format.
- **Reduce costs** by removing manual data entry and file generation, reducing
  payment processing time, and reducing errors.

## Requirements

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

## Installation

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

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

## Quick Start

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,
- **XSD schema file** to validate the generated XML file, and
- **Data file (CSV or SQLite)** containing the payment instructions that you
  want to submit.

Here’s how you would do that:

```sh
python3 -m pain001 \
    -t <xml_message_type> \
    -m <xml_template_file_path> \
    -s <xsd_schema_file_path> \
    -d <data_file_path>
```

### Arguments

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.

## Examples

The following examples demonstrate how to use **Pain001** to generate a payment
initiation message from a CSV file and a SQLite Data file.

### Using a CSV Data File as the source

```sh
python3 -m pain001 \
    -t pain.001.001.03 \
    -m /path/to/your/template.xml \
    -s /path/to/your/pain.001.001.03.xsd \
    -d /path/to/your/template.csv
```

### Using a SQLite Data File as the source

```sh
python3 -m pain001 \
    -t pain.001.001.03 \
    -m /path/to/your/template.xml \
    -s /path/to/your/pain.001.001.03.xsd \
    -d /path/to/your/template.db
```

### Using the Source code

You can clone the source code and run the example code in your
terminal/command-line. To check out the source code, clone the repository from
GitHub:

```sh
git clone https://github.com/sebastienrousseau/pain001.git
```

#### Pain.001.001.03

This will generate a payment initiation message in the format of
Pain.001.001.03.

```sh
python -m pain001 \
    -t pain.001.001.03 \
    -m pain001/templates/pain.001.001.03/template.xml \
    -s pain001/templates/pain.001.001.03/pain.001.001.03.xsd \
    -d pain001/templates/pain.001.001.03/template.csv
```

#### Pain.001.001.04

This will generate a payment initiation message in the format of
Pain.001.001.04.

```sh
python -m pain001 \
    -t pain.001.001.04 \
    -m pain001/templates/pain.001.001.04/template.xml \
    -s pain001/templates/pain.001.001.04/pain.001.001.04.xsd \
    -d pain001/templates/pain.001.001.04/template.csv
```

#### Pain.001.001.05

This will generate a payment initiation message in the format of
Pain.001.001.05.

```sh
python -m pain001 \
    -t pain.001.001.05 \
    -m pain001/templates/pain.001.001.05/template.xml \
    -s pain001/templates/pain.001.001.05/pain.001.001.05.xsd \
    -d pain001/templates/pain.001.001.05/template.csv
```

#### Pain.001.001.06

This will generate a payment initiation message in the format of
Pain.001.001.06.

```sh
python -m pain001 \
    -t pain.001.001.06 \
    -m pain001/templates/pain.001.001.06/template.xml \
    -s pain001/templates/pain.001.001.06/pain.001.001.06.xsd \
    -d pain001/templates/pain.001.001.06/template.csv
```

#### Pain.001.001.07

This will generate a payment initiation message in the format of
Pain.001.001.07.

```sh
python -m pain001 \
    -t pain.001.001.07 \
    -m pain001/templates/pain.001.001.07/template.xml \
    -s pain001/templates/pain.001.001.07/pain.001.001.07.xsd \
    -d pain001/templates/pain.001.001.07/template.csv
```

#### Pain.001.001.08

This will generate a payment initiation message in the format of
Pain.001.001.08.

```sh
python -m pain001 \
    -t pain.001.001.08 \
    -m pain001/templates/pain.001.001.08/template.xml \
    -s pain001/templates/pain.001.001.08/pain.001.001.08.xsd \
    -d pain001/templates/pain.001.001.08/template.csv
```

#### Pain.001.001.09

This will generate a payment initiation message in the format of
Pain.001.001.09.

```sh
python -m pain001 \
    -t pain.001.001.09 \
    -m pain001/templates/pain.001.001.09/template.xml \
    -s pain001/templates/pain.001.001.09/pain.001.001.09.xsd \
    -d pain001/templates/pain.001.001.09/template.csv
```

You can do the same with the sample SQLite Data file:

```sh
python3 -m pain001 \
    -t pain.001.001.03 \
    -m pain001/templates/pain.001.001.03/template.xml \
    -s pain001/templates/pain.001.001.03/pain.001.001.03.xsd \
    -d pain001/templates/pain.001.001.03/template.db
```

> **Note:** The XML file that **Pain001** generates will automatically be
> validated against the XSD template file before the new XML file is saved. If
> the validation fails, **Pain001** will stop running and display an error
> message in your terminal.

### Embedded in an Application

To embed **Pain001** in a new or existing application, import the main function
and use it in your code.

Here's an example:

```python
from pain001 import main

if __name__ == '__main__':
    xml_message_type = 'pain.001.001.03'
    xml_template_file_path = 'template.xml'
    xsd_schema_file_path = 'schema.xsd'
    data_file_path = 'data.csv'
    main(
        xml_message_type,
        xml_template_file_path,
        xsd_schema_file_path,
        data_file_path
    )
```

### Validation

To validate the generated XML file against a given xsd schema, use the following
method:

```python
from pain001.core import validate_xml_against_xsd

xml_message_type = 'pain.001.001.03'
xml_file = 'generated.xml'
xsd_file = 'schema.xsd'

is_valid = validate_xml_against_xsd(
    xml_message_type,
    xml_file,
    xsd_file
)
print(f"XML validation result: {is_valid}")
```

## Documentation

> **Info:** Do check out our [website][00] for comprehensive documentation.

### Supported messages

This section gives access to the documentation related to the ISO 20022 message
definitions supported by **Pain001**.

#### Bank-to-Customer Cash Management

Set of messages used to request and provide account information for
reconciliation and cash positioning between an account servicer and its
customer.

| Status | Message type    | Name                               |
| ------ | --------------- | ---------------------------------- |
| ⏳      | camt.052.001.10 | Bank-to-Customer Account Statement |
| ⏳      | camt.053.001.10 | Customer Account Identification    |
| ⏳      | camt.054.001.10 | Customer Account Statement Request |
| ⏳      | camt.060.001.10 | Customer Account Notification      |

#### Payments Clearing and Settlement

Set of messages used between financial institutions for the clearing and
settlement of payment transactions.

| Status | Message type    | Name                               |
| ------ | --------------- | ---------------------------------- |
| ⏳      | pacs.002.001.12 | Credit Transfer Notification       |
| ⏳      | pacs.003.001.09 | Direct Debit Initiation            |
| ⏳      | pacs.004.001.11 | Direct Debit Reversal              |
| ⏳      | pacs.007.001.11 | Customer Direct Debit Confirmation |
| ⏳      | pacs.008.001.10 | Credit Transfer Initiation         |
| ⏳      | pacs.009.001.10 | Credit Transfer Reversal           |
| ⏳      | pacs.010.001.05 | Account Identification             |
| ⏳      | pacs.028.001.05 | Account Statement Request          |

#### Payments Initiation

Set of messages exchanged between a debtor (or buyer) and its bank or between a
creditor (or seller) and its bank to initiate, collect, manage and monitor
payments.

| Status | Message type                       | Name              |
| ------ | ---------------- | ----------------------------------- |
| ✅      | pain.001.001.03 | Customer Credit Transfer Initiation |
| ✅      | pain.001.001.04 | Customer Direct Debit Initiation    |
| ✅      | 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.09 | Customer Credit Transfer Initiation |
| ⏳      | pain.001.001.10 | Customer Account Closure Request    |
| ⏳      | pain.001.001.11 | Customer Account Change Request     |

## License

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

- [Apache License, Version 2.0][01]
- [MIT license][02]

## Contribution

We welcome contributions to **Pain001**. Please see the
[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 Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.

## Acknowledgements

We would like to extend a big thank you to all the awesome contributors of
[Pain001][05] for their help and support.

[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/

[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.'
[codecov-badge]: https://img.shields.io/codecov/c/github/sebastienrousseau/pain001?style=for-the-badge&token=AaUxKfRiou 'Codecov badge'
[license-badge]: https://img.shields.io/pypi/l/pain001?style=for-the-badge 'License badge'
[pypi-badge]: https://img.shields.io/pypi/pyversions/pain001.svg?style=for-the-badge 'PyPI badge'
[pypi-downloads-badge]:https://img.shields.io/pypi/dm/pain001.svg?style=for-the-badge 'PyPI Downloads badge'

            

Raw data

            {
    "_id": null,
    "home_page": "https://pain001.com",
    "name": "pain001",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.9",
    "maintainer_email": null,
    "keywords": "pain001, iso20022, payment-processing, automate-payments, sepa, financial, banking-payments, csv, sqlite",
    "author": "Sebastien Rousseau",
    "author_email": "sebastian.rousseau@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/2f/52/c0e8604ea9e8f71109ec34228a77f8e302ee176bf5794c2b175701c5ccd2/pain001-0.0.25.tar.gz",
    "platform": null,
    "description": "# Pain001: Automate ISO 20022-Compliant Payment File Creation\n\n![Pain001 banner][banner]\n\n## A Powerful Python Library that enables you to create ISO 20022-Compliant Payment Files directly from CSV or SQLite data files\n\n[![PyPI][pypi-badge]][03] [![PyPI Downloads][pypi-downloads-badge]][07] [![License][license-badge]][01] [![Codecov][codecov-badge]][06]\n\n## Overview\n\n**Pain001** is an open-source Python Library that you can use to create **ISO\n20022-Compliant Payment Files** directly from your **CSV** or **SQLite** Data\nFiles.\n\n- **Website:** <https://pain001.com>\n- **Source code:** <https://github.com/sebastienrousseau/pain001>\n- **Bug reports:** <https://github.com/sebastienrousseau/pain001/issues>\n\nThe Python library focuses specifically on **Payment Initiation and Advice\nMessages**, commonly known as **Pain**. In a very simplified way, a\n**pain.001** is a message that initiates the customer payment.\n\nAs of today, the library is designed to be compatible with the:\n\n- **Payments Initiation V03 (pain.001.001.03)**: This version is used for\n  initiating credit transfers within the SEPA (Single Euro Payments Area).\n- **Payments Initiation V04 (pain.001.001.04)**: Introduced support for non-SEPA\n  payments and additional functionalities.\n- **Payments Initiation V05 (pain.001.001.05)**: Brought further enhancements\n  and clarifications.\n- **Payments Initiation V06 (pain.001.001.06)**: Focused on introducing support\n  for instant payments.\n- **Payments Initiation V07 (pain.001.001.07)**: Added support for Request for\n  Large Payment (RLP) and Request to Modify Payment (RTP) functionalities.\n- **Payments Initiation V08 (pain.001.001.08)**: Included support for the TARGET\n  Instant Settlement Service (TISS) and introduced a new pain.002 message type\n  for debit transfers.\n- **Payments Initiation V09 (pain.001.001.09)**: The latest version, which\n  introduced support for Request for Account Information (RAI) functionality.\n\nPayments usually start with a **pain.001 payment initiation message**. The payer\nsends it to the payee (or the payee\u2019s bank) via a secure network. This network\ncould be **SWIFT** or **SEPA (Single Euro Payments Area) network**, or other\npayment networks such as **CHAPS**, **BACS**, **Faster Payments**, etc. The\nmessage contains the payer\u2019s and payee\u2019s bank account details, payment amount,\nand other information required to process the payment.\n\nThe **Pain001** library can reduce payment processing complexity and costs by\ngenerating ISO 20022-compliant payment files. These files automatically remove\nthe need to create and validate them manually, making the payment process more\nefficient and cost-effective. It will save you time and resources and minimize\nthe risk of errors, ensuring accurate and seamless payment processing.\n\nUse the **Pain001** library to simplify, accelerate, and automate your payment\nprocessing.\n\n## Table of Contents\n\n- [Pain001: Automate ISO 20022-Compliant Payment File Creation](#pain001-automate-iso-20022-compliant-payment-file-creation)\n  - [A Powerful Python Library that enables you to create ISO 20022-Compliant Payment Files directly from CSV or SQLite data files](#a-powerful-python-library-that-enables-you-to-create-iso-20022-compliant-payment-files-directly-from-csv-or-sqlite-data-files)\n  - [Overview](#overview)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Requirements](#requirements)\n  - [Installation](#installation)\n    - [Install `virtualenv`](#install-virtualenv)\n    - [Create a Virtual Environment](#create-a-virtual-environment)\n    - [Activate environment](#activate-environment)\n    - [Getting Started](#getting-started)\n  - [Quick Start](#quick-start)\n    - [Arguments](#arguments)\n  - [Examples](#examples)\n    - [Using a CSV Data File as the source](#using-a-csv-data-file-as-the-source)\n    - [Using a SQLite Data File as the source](#using-a-sqlite-data-file-as-the-source)\n    - [Using the Source code](#using-the-source-code)\n      - [Pain.001.001.03](#pain00100103)\n      - [Pain.001.001.04](#pain00100104)\n      - [Pain.001.001.05](#pain00100105)\n      - [Pain.001.001.06](#pain00100106)\n      - [Pain.001.001.07](#pain00100107)\n      - [Pain.001.001.08](#pain00100108)\n      - [Pain.001.001.09](#pain00100109)\n    - [Embedded in an Application](#embedded-in-an-application)\n    - [Validation](#validation)\n  - [Documentation](#documentation)\n    - [Supported messages](#supported-messages)\n      - [Bank-to-Customer Cash Management](#bank-to-customer-cash-management)\n      - [Payments Clearing and Settlement](#payments-clearing-and-settlement)\n      - [Payments Initiation](#payments-initiation)\n  - [License](#license)\n  - [Contribution](#contribution)\n  - [Acknowledgements](#acknowledgements)\n\n## Features\n\n- **Easy to use:** Both developers and non-developers can easily use the\n  library, as it requires minimal coding knowledge.\n- **Open-source**: The library is open-source and free to use, making it\n  accessible to everyone.\n- **Secure**: The library is secure and does not store any sensitive data,\n  ensuring that all information remains confidential.\n- **Customizable**: The library allows developers to customize the output,\n  making it adaptable to specific business requirements and preferences.\n- **Scalable solution**: The **Pain001** library can handle varying volumes of\n  payment files, making it suitable for businesses of different sizes and\n  transaction volumes.\n- **Time-saving**: The automated file creation process reduces the time spent on\n  manual data entry and file generation, increasing overall productivity.\n- **Seamless integration**: As a Python package, the Pain001 library is\n  compatible with various Python-based applications and easily integrates into\n  any existing projects or workflows.\n- **Cross-border compatibility**: The library supports both Single Euro Payments\n  Area (SEPA) and non-SEPA credit transfers, making it versatile for use in\n  different countries and regions.\n- **Improve accuracy** by providing precise data; the library reduces errors in\n  payment file creation and processing.\n- **Enhance efficiency** by automating the creation of Payment Initiation\n  message files\n- **Accelerate payment file creation** by automating the process and reducing\n  the time required to create payment files.\n- **Guarantee the highest quality and compliance** by validating all payment\n  files to meet the ISO 20022 standards.\n- **Simplify ISO 20022-compliant payment initiation message creation** by\n  providing a standardized payment file format.\n- **Reduce costs** by removing manual data entry and file generation, reducing\n  payment processing time, and reducing errors.\n\n## Requirements\n\n**Pain001** works with macOS, Linux, and Windows and requires Python 3.9.0 and\nabove.\n\n## Installation\n\nWe recommend creating a virtual environment to install **Pain001**. This will\nensure that the package is installed in an isolated environment and will not\naffect other projects. To install **Pain001** in a virtual environment, follow\nthese steps:\n\n### Install `virtualenv`\n\n```sh\npython -m pip install virtualenv\n```\n\n### Create a Virtual Environment\n\n```sh\npython -m venv venv\n```\n\n| Code  | Explanation                     |\n| ----- | ------------------------------- |\n| `-m`  | executes module `venv`          |\n| `env` | name of the virtual environment |\n\n### Activate environment\n\n```sh\nsource venv/bin/activate\n```\n\n### Getting Started\n\nIt takes just a few seconds to get up and running with **Pain001**. You can\ninstall Pain001 from PyPI with pip or your favourite package manager:\n\nOpen your terminal and run the following command to add the latest version:\n\n```sh\npython -m pip install pain001\n```\n\nAdd the -U switch to update to the current version, if `pain001` is already\ninstalled.\n\n```sh\npython -m pip install -U pain001\n```\n\n## Quick Start\n\nAfter installation, you can run **Pain001** directly from the command line.\nSimply call the main module pain001 with the paths of your:\n\n- **XML template file** containing the various parameters you want to pass from\n  your Data file,\n- **XSD schema file** to validate the generated XML file, and\n- **Data file (CSV or SQLite)** containing the payment instructions that you\n  want to submit.\n\nHere\u2019s how you would do that:\n\n```sh\npython3 -m pain001 \\\n    -t <xml_message_type> \\\n    -m <xml_template_file_path> \\\n    -s <xsd_schema_file_path> \\\n    -d <data_file_path>\n```\n\n### Arguments\n\nWhen running **Pain001**, you will need to specify four arguments:\n\n- An `xml_message_type`: This is the type of XML message you want to generate.\n\n  The currently supported types are:\n\n  - pain.001.001.03\n  - pain.001.001.04\n  - pain.001.001.05\n  - pain.001.001.06\n  - pain.001.001.07\n  - pain.001.001.08\n  - pain.001.001.09\n\n- An `xml_template_file_path`: This is the path to the XML template file you are\n  using that contains variables that will be replaced by the values in your\n\n  Data file.\n\n- An `xsd_schema_file_path`: This is the path to the XSD schema file you are\n  using to validate the generated XML file.\n\n- A `data_file_path`: This is the path to the CSV or SQLite Data file you want\n  to convert to XML format.\n\n## Examples\n\nThe following examples demonstrate how to use **Pain001** to generate a payment\ninitiation message from a CSV file and a SQLite Data file.\n\n### Using a CSV Data File as the source\n\n```sh\npython3 -m pain001 \\\n    -t pain.001.001.03 \\\n    -m /path/to/your/template.xml \\\n    -s /path/to/your/pain.001.001.03.xsd \\\n    -d /path/to/your/template.csv\n```\n\n### Using a SQLite Data File as the source\n\n```sh\npython3 -m pain001 \\\n    -t pain.001.001.03 \\\n    -m /path/to/your/template.xml \\\n    -s /path/to/your/pain.001.001.03.xsd \\\n    -d /path/to/your/template.db\n```\n\n### Using the Source code\n\nYou can clone the source code and run the example code in your\nterminal/command-line. To check out the source code, clone the repository from\nGitHub:\n\n```sh\ngit clone https://github.com/sebastienrousseau/pain001.git\n```\n\n#### Pain.001.001.03\n\nThis will generate a payment initiation message in the format of\nPain.001.001.03.\n\n```sh\npython -m pain001 \\\n    -t pain.001.001.03 \\\n    -m pain001/templates/pain.001.001.03/template.xml \\\n    -s pain001/templates/pain.001.001.03/pain.001.001.03.xsd \\\n    -d pain001/templates/pain.001.001.03/template.csv\n```\n\n#### Pain.001.001.04\n\nThis will generate a payment initiation message in the format of\nPain.001.001.04.\n\n```sh\npython -m pain001 \\\n    -t pain.001.001.04 \\\n    -m pain001/templates/pain.001.001.04/template.xml \\\n    -s pain001/templates/pain.001.001.04/pain.001.001.04.xsd \\\n    -d pain001/templates/pain.001.001.04/template.csv\n```\n\n#### Pain.001.001.05\n\nThis will generate a payment initiation message in the format of\nPain.001.001.05.\n\n```sh\npython -m pain001 \\\n    -t pain.001.001.05 \\\n    -m pain001/templates/pain.001.001.05/template.xml \\\n    -s pain001/templates/pain.001.001.05/pain.001.001.05.xsd \\\n    -d pain001/templates/pain.001.001.05/template.csv\n```\n\n#### Pain.001.001.06\n\nThis will generate a payment initiation message in the format of\nPain.001.001.06.\n\n```sh\npython -m pain001 \\\n    -t pain.001.001.06 \\\n    -m pain001/templates/pain.001.001.06/template.xml \\\n    -s pain001/templates/pain.001.001.06/pain.001.001.06.xsd \\\n    -d pain001/templates/pain.001.001.06/template.csv\n```\n\n#### Pain.001.001.07\n\nThis will generate a payment initiation message in the format of\nPain.001.001.07.\n\n```sh\npython -m pain001 \\\n    -t pain.001.001.07 \\\n    -m pain001/templates/pain.001.001.07/template.xml \\\n    -s pain001/templates/pain.001.001.07/pain.001.001.07.xsd \\\n    -d pain001/templates/pain.001.001.07/template.csv\n```\n\n#### Pain.001.001.08\n\nThis will generate a payment initiation message in the format of\nPain.001.001.08.\n\n```sh\npython -m pain001 \\\n    -t pain.001.001.08 \\\n    -m pain001/templates/pain.001.001.08/template.xml \\\n    -s pain001/templates/pain.001.001.08/pain.001.001.08.xsd \\\n    -d pain001/templates/pain.001.001.08/template.csv\n```\n\n#### Pain.001.001.09\n\nThis will generate a payment initiation message in the format of\nPain.001.001.09.\n\n```sh\npython -m pain001 \\\n    -t pain.001.001.09 \\\n    -m pain001/templates/pain.001.001.09/template.xml \\\n    -s pain001/templates/pain.001.001.09/pain.001.001.09.xsd \\\n    -d pain001/templates/pain.001.001.09/template.csv\n```\n\nYou can do the same with the sample SQLite Data file:\n\n```sh\npython3 -m pain001 \\\n    -t pain.001.001.03 \\\n    -m pain001/templates/pain.001.001.03/template.xml \\\n    -s pain001/templates/pain.001.001.03/pain.001.001.03.xsd \\\n    -d pain001/templates/pain.001.001.03/template.db\n```\n\n> **Note:** The XML file that **Pain001** generates will automatically be\n> validated against the XSD template file before the new XML file is saved. If\n> the validation fails, **Pain001** will stop running and display an error\n> message in your terminal.\n\n### Embedded in an Application\n\nTo embed **Pain001** in a new or existing application, import the main function\nand use it in your code.\n\nHere's an example:\n\n```python\nfrom pain001 import main\n\nif __name__ == '__main__':\n    xml_message_type = 'pain.001.001.03'\n    xml_template_file_path = 'template.xml'\n    xsd_schema_file_path = 'schema.xsd'\n    data_file_path = 'data.csv'\n    main(\n        xml_message_type,\n        xml_template_file_path,\n        xsd_schema_file_path,\n        data_file_path\n    )\n```\n\n### Validation\n\nTo validate the generated XML file against a given xsd schema, use the following\nmethod:\n\n```python\nfrom pain001.core import validate_xml_against_xsd\n\nxml_message_type = 'pain.001.001.03'\nxml_file = 'generated.xml'\nxsd_file = 'schema.xsd'\n\nis_valid = validate_xml_against_xsd(\n    xml_message_type,\n    xml_file,\n    xsd_file\n)\nprint(f\"XML validation result: {is_valid}\")\n```\n\n## Documentation\n\n> **Info:** Do check out our [website][00] for comprehensive documentation.\n\n### Supported messages\n\nThis section gives access to the documentation related to the ISO 20022 message\ndefinitions supported by **Pain001**.\n\n#### Bank-to-Customer Cash Management\n\nSet of messages used to request and provide account information for\nreconciliation and cash positioning between an account servicer and its\ncustomer.\n\n| Status | Message type    | Name                               |\n| ------ | --------------- | ---------------------------------- |\n| \u23f3      | camt.052.001.10 | Bank-to-Customer Account Statement |\n| \u23f3      | camt.053.001.10 | Customer Account Identification    |\n| \u23f3      | camt.054.001.10 | Customer Account Statement Request |\n| \u23f3      | camt.060.001.10 | Customer Account Notification      |\n\n#### Payments Clearing and Settlement\n\nSet of messages used between financial institutions for the clearing and\nsettlement of payment transactions.\n\n| Status | Message type    | Name                               |\n| ------ | --------------- | ---------------------------------- |\n| \u23f3      | pacs.002.001.12 | Credit Transfer Notification       |\n| \u23f3      | pacs.003.001.09 | Direct Debit Initiation            |\n| \u23f3      | pacs.004.001.11 | Direct Debit Reversal              |\n| \u23f3      | pacs.007.001.11 | Customer Direct Debit Confirmation |\n| \u23f3      | pacs.008.001.10 | Credit Transfer Initiation         |\n| \u23f3      | pacs.009.001.10 | Credit Transfer Reversal           |\n| \u23f3      | pacs.010.001.05 | Account Identification             |\n| \u23f3      | pacs.028.001.05 | Account Statement Request          |\n\n#### Payments Initiation\n\nSet of messages exchanged between a debtor (or buyer) and its bank or between a\ncreditor (or seller) and its bank to initiate, collect, manage and monitor\npayments.\n\n| Status | Message type                       | Name              |\n| ------ | ---------------- | ----------------------------------- |\n| \u2705      | pain.001.001.03 | Customer Credit Transfer Initiation |\n| \u2705      | pain.001.001.04 | Customer Direct Debit Initiation    |\n| \u2705      | pain.001.001.05 | Customer Direct Debit Reversal      |\n| \u2705      | pain.001.001.06 | Customer Credit Transfer Reversal   |\n| \u2705      | pain.001.001.07 | Customer Account Notification       |\n| \u2705      | pain.001.001.08 | Customer Account Statement          |\n| \u2705      | pain.001.001.09 | Customer Credit Transfer Initiation |\n| \u23f3      | pain.001.001.10 | Customer Account Closure Request    |\n| \u23f3      | pain.001.001.11 | Customer Account Change Request     |\n\n## License\n\nThe project is licensed under the terms of both the MIT license and the Apache\nLicense (Version 2.0).\n\n- [Apache License, Version 2.0][01]\n- [MIT license][02]\n\n## Contribution\n\nWe welcome contributions to **Pain001**. Please see the\n[contributing instructions][04] for more information.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\n## Acknowledgements\n\nWe would like to extend a big thank you to all the awesome contributors of\n[Pain001][05] for their help and support.\n\n[00]: https://pain001.com\n[01]: https://opensource.org/license/apache-2-0/\n[02]: http://opensource.org/licenses/MIT\n[03]: https://github.com/sebastienrousseau/pain001\n[04]: https://github.com/sebastienrousseau/pain001/blob/main/CONTRIBUTING.md\n[05]: https://github.com/sebastienrousseau/pain001/graphs/contributors\n[06]: https://codecov.io/github/sebastienrousseau/pain001?branch=main\n[07]: https://pypi.org/project/pain001/\n\n[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.'\n[codecov-badge]: https://img.shields.io/codecov/c/github/sebastienrousseau/pain001?style=for-the-badge&token=AaUxKfRiou 'Codecov badge'\n[license-badge]: https://img.shields.io/pypi/l/pain001?style=for-the-badge 'License badge'\n[pypi-badge]: https://img.shields.io/pypi/pyversions/pain001.svg?style=for-the-badge 'PyPI badge'\n[pypi-downloads-badge]:https://img.shields.io/pypi/dm/pain001.svg?style=for-the-badge 'PyPI Downloads badge'\n",
    "bugtrack_url": null,
    "license": "Apache Software License",
    "summary": "Pain001, A Python Library for Automating ISO 20022-Compliant Payment Files Using CSV Or SQLite Data Files.",
    "version": "0.0.25",
    "project_urls": {
        "Homepage": "https://pain001.com"
    },
    "split_keywords": [
        "pain001",
        " iso20022",
        " payment-processing",
        " automate-payments",
        " sepa",
        " financial",
        " banking-payments",
        " csv",
        " sqlite"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "45cbf4596a5ba35dbda19956278b2a4271691a3b500d0e8b9d13fb2548e47538",
                "md5": "ced4451e1ea61bd2cbc8c45d3ff31442",
                "sha256": "dcd2cf54e4fd778bab6e505ab9a0f8b7731409a9c235d9148641adcca1442064"
            },
            "downloads": -1,
            "filename": "pain001-0.0.25-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ced4451e1ea61bd2cbc8c45d3ff31442",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": "<3.13,>=3.9",
            "size": 19280,
            "upload_time": "2024-05-19T20:50:45",
            "upload_time_iso_8601": "2024-05-19T20:50:45.136821Z",
            "url": "https://files.pythonhosted.org/packages/45/cb/f4596a5ba35dbda19956278b2a4271691a3b500d0e8b9d13fb2548e47538/pain001-0.0.25-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2f52c0e8604ea9e8f71109ec34228a77f8e302ee176bf5794c2b175701c5ccd2",
                "md5": "43f963e3e75fef7456721e9739be5c8d",
                "sha256": "6bb84517dbc2e53dcc6558484c6bf62e97d9dd159bab47d1df98e71c23d5235e"
            },
            "downloads": -1,
            "filename": "pain001-0.0.25.tar.gz",
            "has_sig": false,
            "md5_digest": "43f963e3e75fef7456721e9739be5c8d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.9",
            "size": 33821,
            "upload_time": "2024-05-19T20:50:46",
            "upload_time_iso_8601": "2024-05-19T20:50:46.920327Z",
            "url": "https://files.pythonhosted.org/packages/2f/52/c0e8604ea9e8f71109ec34228a77f8e302ee176bf5794c2b175701c5ccd2/pain001-0.0.25.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-19 20:50:46",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pain001"
}
        
Elapsed time: 4.06141s