iso8583-fps
A small, dependency-free ISO 8583 codec in Python, with a UK Faster Payments (FPS) message profile — in both ASCII and BCD/binary encodings.
ISO 8583 is the classic card / interbank message format (4-digit MTI, a primary + optional
secondary bitmap flagging which data elements are present, and typed data elements framed as
fixed / LLVAR / LLLVAR). UK Faster Payments is ISO 8583:1993-based, yet there's almost
no small, readable, open implementation to point people at. This is that.
- Real codec, two encodings.
pack()/unpack()are proven inverses over a data-element registry — an ASCII form (hex bitmap, ASCII digits) and a BCD/binary form (raw-byte bitmap, BCD-packed numerics) — the way switches actually send it. - Zero dependencies. Pure standard library. One file.
- FPS profile.
fps_request()maps a payment onto an MTI0200;fps_response()builds an MTI0210with a response code. Works on a plaindict— no framework.
from iso8583_fps import fps_request, unpack, FIELDS
msg = fps_request({
"reference": "INV-9",
"amount": "123.45",
"currency": "GBP",
"debtor": {"sort_code": "123456", "account_number": "00087654"},
"creditor": {"name": "Bob", "sort_code": "654321", "account_number": "00012345"},
"remittance": "invoice 9",
})
print(msg) # 0200B0200000... (ASCII)
mti, fields = unpack(msg)
print(mti) # 0200
for de, val in sorted(fields.items()):
print(de, FIELDS[de][3], "=", val) # 4 Amount = 000000012345, 49 Currency = 826, ...
# BCD/binary encoding — how a switch actually sends it:
raw = fps_request({...}, binary=True) # -> bytes
mti, fields = unpack(raw, binary=True) # round-trips
Install
Copy the single file, or:
pip install iso8583-fps # once published to PyPI — see PUBLISHING.md
Data elements (FPS profile)
| DE | Meaning | Format |
|---|---|---|
| 3 | Processing code | n6 |
| 4 | Amount (minor units) | n12 |
| 7 | Transmission date/time | n10 |
| 11 | STAN | n6 |
| 32 | Acquiring institution (sort code) | LLVAR n |
| 37 | Retrieval reference | an12 |
| 39 | Response code | an2 |
| 49 | Currency (ISO 4217 numeric) | n3 |
| 102 | Account id — from | LLVAR ans |
| 103 | Account id — to | LLVAR ans |
| 120 | Creditor name (private) | LLLVAR ans |
| 121 | Remittance / reference (private) | LLLVAR ans |
Honest boundary
This is a structurally-real, FPS-flavoured profile — not the bit-exact, licensed Pay.UK /
Vocalink data-element map (that specification is member-only and not public). The MTIs, processing
codes and DE assignments here are reasonable conventions. Swapping in the licensed assignments is a
data change to the FIELDS registry, not a rewrite. The generic pack()/unpack() are standard
ISO 8583 and are correct as-is.
Why this exists
Built as part of KibiPay — a payments-interoperability platform that maps
UK bank rails, Mojaloop mobile money, and Solana settlement onto one canonical model (an ISO 20022
superset), so a payment can arrive as ISO 8583 on FPS and leave as ISO 20022 pacs.008 on another
rail. Free interactive tools (an ISO 8583 decoder, an ISO 20022 viewer, an MT↔MX mapper) live at
kibipay.com.
License
MIT — see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iso8583_fps-0.1.0.tar.gz.
File metadata
- Download URL: iso8583_fps-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b04ab02108ef313d55d39f8afff0894a02ba451a85e18a149c1ad1a1db7b63f3
|
|
| MD5 |
1010c319ac5a00cef1da109c23f910ca
|
|
| BLAKE2b-256 |
92ff98c4328a730cfa1a9b844688e7c7fa8881a968b36bda5bd17d17c8fa0952
|
Provenance
The following attestation bundles were made for iso8583_fps-0.1.0.tar.gz:
Publisher:
publish.yml on tarvitave/iso8583-fps
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iso8583_fps-0.1.0.tar.gz -
Subject digest:
b04ab02108ef313d55d39f8afff0894a02ba451a85e18a149c1ad1a1db7b63f3 - Sigstore transparency entry: 2272633180
- Sigstore integration time:
-
Permalink:
tarvitave/iso8583-fps@57c2136d5f759828a73a026d08af6ee493de9593 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tarvitave
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@57c2136d5f759828a73a026d08af6ee493de9593 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file iso8583_fps-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iso8583_fps-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7db08001c369540d516bf53fdef649e1d2605efd058e4115fcdac537b9b752e5
|
|
| MD5 |
d08490bbed43dacee19ec3c6adfc8332
|
|
| BLAKE2b-256 |
e6b7c4d3ca65030f9b430774ee07a4961e2daa9f5567ffea1012a2bf634240bc
|
Provenance
The following attestation bundles were made for iso8583_fps-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on tarvitave/iso8583-fps
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iso8583_fps-0.1.0-py3-none-any.whl -
Subject digest:
7db08001c369540d516bf53fdef649e1d2605efd058e4115fcdac537b9b752e5 - Sigstore transparency entry: 2272633304
- Sigstore integration time:
-
Permalink:
tarvitave/iso8583-fps@57c2136d5f759828a73a026d08af6ee493de9593 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tarvitave
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@57c2136d5f759828a73a026d08af6ee493de9593 -
Trigger Event:
workflow_dispatch
-
Statement type: