Skip to content

Commit

Permalink
Added ADMI
Browse files Browse the repository at this point in the history
  • Loading branch information
phoughton committed Aug 15, 2024
1 parent 75ea63f commit 1f56e9a
Show file tree
Hide file tree
Showing 16 changed files with 3,473 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ pyiso20022/pacs/
pyiso20022/head/
pyiso20022/camt/
pyiso20022/pain/
pyiso20022/admi/

pyiso20022/*.py

temp/
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ Table of Contents: _(Links to this page on GitHub)_
1. [Parse an ISO 20022 PAIN.001 message](https://github.com/phoughton/pyiso20022/blob/main/README.md#parse-an-iso-20022-pain001-message)
1. [Create a ISO 20022 PAIN.001 message](https://github.com/phoughton/pyiso20022/blob/main/README.md#create-a-iso-20022-pain001-message)
1. [Create a ISO 20022 PACS.008 message](https://github.com/phoughton/pyiso20022/blob/main/README.md#create-a-iso-20022-pacs008-message)
1. [Convert a CAMT.053 into an Excel file](https://github.com/phoughton/pyiso20022/blob/main/README.md#convert-a-camt053-into-an-excel-file)


# PYISO20022 an ISO 20022 Message Generator and Parser

A package of classes to support payment, financial, securities & accounting message generation (for ISO 20022 messages).

These are the type of payments messages used in payment schemes such as FedNow, TARGET2, CHAPS, CBPR+, MEPS+ and other SWIFT/Wire Transfer style payments etc. You may hear them refered to as PACS messages (but there are others types as well, like CAMT.056 or PAIN.001).
These are the type of payments messages used in payment schemes such as FedNow, FedWire, TARGET2, CHAPS, CBPR+, MEPS+ and other SWIFT/Wire Transfer style payments etc. You may hear them refered to as PACS messages (but there are others types as well, like CAMT.056 or PAIN.001 or ADMI.004 etc).

You might use these messages if you intitate payments from your company into a larger financial institution, in this scenario you will be generating PAIN (thats _Payment Initiation_) messages.

Expand Down Expand Up @@ -296,7 +297,7 @@ with open("my_pacs_008_from_code.xml", "w") as xml_file:

```

## Convert a CAMT.053 into an Excel file?
## Convert a CAMT.053 into an Excel file

You can convert the entries in a CAMT.053 into a Excel file using the tools in pyiso20022.

Expand All @@ -318,7 +319,7 @@ And you'll get something like this when you open your Excel file:


## Message types?
Currently pyiso20022 supports PACS, PAIN and CAMT messages as well as HEAD (header documents for the messages).
Currently pyiso20022 supports PACS, PAIN, ADMI and CAMT messages as well as HEAD (header documents for the messages).


## Source of truth?
Expand Down
4 changes: 3 additions & 1 deletion build_classes_from_xsds.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ generate_xsdata() {
done
}

REMOVE_DIRS=("pacs" "head" "pain" "camt")
REMOVE_DIRS=("pacs" "head" "pain" "camt" "admi")

for a_dir in "${REMOVE_DIRS[@]}"
do
Expand All @@ -30,6 +30,8 @@ generate_xsdata "pacs" "xsd/payments_clearing_and_settlement"
generate_xsdata "head" "xsd/business_application_header"
generate_xsdata "pain" "xsd/payments_initiation"
generate_xsdata "camt" "xsd/cash_management"
generate_xsdata "admi" "xsd/administration"

wait
cat supported_msg_types.md | sort -n | uniq > supported_msg_types_final.md
rm supported_msg_types.md
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pyiso20022",
version="1.1.2",
version="1.2.2",
author="Peter Houghton",
author_email="[email protected]",
description="pyiso20022 is a library for generating ISO20022 messages in Python.",
Expand Down
10 changes: 10 additions & 0 deletions supported_msg_types_final.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Supported message types
- admi.admi_002_001_01
- admi.admi_004_001_02
- admi.admi_006_001_01
- admi.admi_007_001_01
- admi.admi_009_001_02
- admi.admi_010_001_02
- admi.admi_011_001_01
- admi.admi_017_001_01
- camt.camt_025_001_08
- camt.camt_026_001_01
- camt.camt_026_001_03
Expand Down Expand Up @@ -42,6 +50,7 @@
- camt.camt_053_001_09
- camt.camt_053_001_10
- camt.camt_053_001_11
- camt.camt_053_001_12
- camt.camt_054_001_01
- camt.camt_054_001_02
- camt.camt_054_001_03
Expand Down Expand Up @@ -69,6 +78,7 @@
- camt.camt_060_001_04
- camt.camt_060_001_05
- camt.camt_060_001_06
- camt.camt_060_001_07
- camt.camt_110_001_01
- camt.camt_111_001_01
- head.head_001_001_02
Expand Down
8 changes: 4 additions & 4 deletions tests/create_pain_msgs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def create_pain001_001_008():
))

initg_pty = PartyIdentification43(nm="TXB Test Account",
id=initg_pty__id)

id=initg_pty__id)

grp_hdr = GroupHeader48(msg_id="test-160620",
cre_dt_tm="2019-12-03T13:01:00+00:00",
Expand Down Expand Up @@ -115,8 +114,9 @@ def test_parse_pain001_001_008(expected_dbtr_postcode, expected_cdtr_postcode):

doc: Document = parser.parse(temp_file, Document, )

dbtr_post_code = doc.cstmr_cdt_trf_initn.pmt_inf[0].dbtr.pstl_adr.pst_cd
cdtr_post_code = doc.cstmr_cdt_trf_initn.pmt_inf[0].cdt_trf_tx_inf[0].cdtr.pstl_adr.pst_cd
pmt_inf = doc.cstmr_cdt_trf_initn.pmt_inf[0]
dbtr_post_code = pmt_inf.dbtr.pstl_adr.pst_cd
cdtr_post_code = pmt_inf.cdt_trf_tx_inf[0].cdtr.pstl_adr.pst_cd

assert dbtr_post_code == expected_dbtr_postcode
assert cdtr_post_code == expected_cdtr_postcode
51 changes: 51 additions & 0 deletions xsd/administration/admi.002/admi.002.001.01.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Standards Editor (build:R1.0.41.3) on 2013 May 27 09:49:00, ISO 20022 version : 2013-->
<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:admi.002.001.01" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:admi.002.001.01">
<xs:element name="Document" type="Document"/>
<xs:complexType name="Document">
<xs:sequence>
<xs:element name="admi.002.001.01" type="admi.002.001.01"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="ISODateTime">
<xs:restriction base="xs:dateTime"/>
</xs:simpleType>
<xs:simpleType name="Max20000Text">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="20000"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Max350Text">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="350"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Max35Text">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="35"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="MessageReference">
<xs:sequence>
<xs:element name="Ref" type="Max35Text"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="RejectionReason2">
<xs:sequence>
<xs:element name="RjctgPtyRsn" type="Max35Text"/>
<xs:element maxOccurs="1" minOccurs="0" name="RjctnDtTm" type="ISODateTime"/>
<xs:element maxOccurs="1" minOccurs="0" name="ErrLctn" type="Max350Text"/>
<xs:element maxOccurs="1" minOccurs="0" name="RsnDesc" type="Max350Text"/>
<xs:element maxOccurs="1" minOccurs="0" name="AddtlData" type="Max20000Text"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="admi.002.001.01">
<xs:sequence>
<xs:element name="RltdRef" type="MessageReference"/>
<xs:element name="Rsn" type="RejectionReason2"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
45 changes: 45 additions & 0 deletions xsd/administration/admi.004/admi.004.001.02.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Standards Editor (build:R1.6.2.2) on 2014 Dec 18 12:57:31, ISO 20022 version : 2013-->
<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:admi.004.001.02" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:admi.004.001.02">
<xs:element name="Document" type="Document"/>
<xs:complexType name="Document">
<xs:sequence>
<xs:element name="SysEvtNtfctn" type="SystemEventNotificationV02"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Event2">
<xs:sequence>
<xs:element name="EvtCd" type="Max4AlphaNumericText"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="EvtParam" type="Max35Text"/>
<xs:element maxOccurs="1" minOccurs="0" name="EvtDesc" type="Max1000Text"/>
<xs:element maxOccurs="1" minOccurs="0" name="EvtTm" type="ISODateTime"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="ISODateTime">
<xs:restriction base="xs:dateTime"/>
</xs:simpleType>
<xs:simpleType name="Max1000Text">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="1000"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Max35Text">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="35"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Max4AlphaNumericText">
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z0-9]{1,4}"/>
<xs:minLength value="1"/>
<xs:maxLength value="4"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="SystemEventNotificationV02">
<xs:sequence>
<xs:element name="EvtInf" type="Event2"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Loading

0 comments on commit 1f56e9a

Please sign in to comment.