Skip to main content

iso8583-fps

CI Python License: MIT

A small, dependency-free ISO 8583 codec in Python, with a UK Faster Payments (FPS) message profile — in both ASCII and BCD/binary encodings.

iso8583-fps decoding an FPS-profiled message

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 MTI 0200; fps_response() builds an MTI 0210 with a response code. Works on a plain dict — 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

iso8583_fps-0.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iso8583_fps-0.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

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

Hashes for iso8583_fps-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b04ab02108ef313d55d39f8afff0894a02ba451a85e18a149c1ad1a1db7b63f3
MD5 1010c319ac5a00cef1da109c23f910ca
BLAKE2b-256 92ff98c4328a730cfa1a9b844688e7c7fa8881a968b36bda5bd17d17c8fa0952

See more details on using hashes here.

Provenance

The following attestation bundles were made for iso8583_fps-0.1.0.tar.gz:

Publisher: publish.yml on tarvitave/iso8583-fps

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for iso8583_fps-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7db08001c369540d516bf53fdef649e1d2605efd058e4115fcdac537b9b752e5
MD5 d08490bbed43dacee19ec3c6adfc8332
BLAKE2b-256 e6b7c4d3ca65030f9b430774ee07a4961e2daa9f5567ffea1012a2bf634240bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for iso8583_fps-0.1.0-py3-none-any.whl:

Publisher: publish.yml on tarvitave/iso8583-fps

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page