ISO 8583 · Python 3.9+ · MIT
The message toolkit that reads like the spec.
Parse, build, and validate ISO 8583 financial messages — with a Python SDK, a CLI, and LLM-assisted explanation for the standard behind every card transaction.
pip install iso8583sim
MTI 0100 · BMP 72 38 00 01 08 20 80 00
DE 2·3·4·7·11·12·13·32·37·43·49 present
Cython fast path
182k parse / 150k build TPS, with a pure-Python fallback when native extensions aren't built.
Every major scheme
VISA, Mastercard, AMEX, Discover, JCB, and UnionPay, each with scheme-specific field rules.
Field 55 TLV
Full chip-card data parsing and building over BER-TLV, tag by tag.
Explain & generate
Read a message in plain English, or generate one from a sentence — OpenAI, Claude, Gemini, or Ollama.
A raw byte stream in. A structured message out.
One call decomposes the wire format into its message type, bitmap, and data elements — validated against the ISO version and, optionally, the card network.
from iso8583sim.core.parser import ISO8583Parser
parser = ISO8583Parser()
parsed = parser.parse(raw) # raw ISO 8583 message
parsed.mti # '0100' — authorization request
parsed.fields[2] # '4111111111111111' — PAN
parsed.fields[4] # '000000001000' — amount, minor units
# Round-trip it back to the wire
from iso8583sim.core.builder import ISO8583Builder
ISO8583Builder().build(parsed) == raw # True| Field | Value | Meaning |
|---|---|---|
| MTI | 0100 | Authorization request |
| BMP | 7238 0001… | Primary bitmap |
| DE 2 | 4111 11•• •••• 1111 | Primary account number |
| DE 3 | 000000 | Processing code — purchase |
| DE 4 | 000000001000 | Amount — $10.00 |
| DE 11 | 123456 | System trace audit number |
Three ways to reach for it.
The same core, exposed however you work — embedded in a service, driven from a shell, or explored interactively.
builder = ISO8583Builder()
msg = ISO8583Message(
mti="0100",
fields={
2: "4111111111111111",
4: "000000001000",
11: "123456",
41: "TERM0001",
},
)
raw = builder.build(msg)
Typed messages, strict validation, object pooling for high-throughput services.
$ iso8583sim parse "0100…" \
--version 1987
$ iso8583sim build \
--mti 0100 --fields fields.json
$ iso8583sim generate \
--type auth --amount 1000
Parse, build, validate, and generate sample messages without writing a line of Python.
notebooks/
01_getting_started.ipynb
02_parsing_messages.ipynb
04_network_specifics.ipynb
05_emv_data.ipynb
07_llm_features.ipynb
08_llm_features_ollama.ipynb
Eight runnable notebooks that teach ISO 8583 from first message to EMV and AI.
Speaks every major card network.
Each scheme carries its own BIN ranges and field conventions. The validator knows them, so your test traffic looks like the real thing.
DE 22DE 25DE 55DE 22DE 48DE 55DE 4DE 44DE 55DE 22DE 55DE 22DE 55DE 22DE 55Ask what a message means. Or describe one and get it back.
The LLM layer sits on top of the parser, so explanations are grounded in a real decode — not a guess. Bring your own provider, cloud or fully offline.
explainer.explain(message)
“A $100.00 VISA purchase authorization at a gas station. The card expires December 2026 and was read via chip (EMV). Expect an 0110 response with code 00 (approved) or 51 (insufficient funds).”
Built to run at line rate.
Optional Cython extensions push the hot paths past 180k transactions per second. Benchmarks on Apple Silicon (M-series), Python 3.12.
GET STARTED
Install it, and read your first message in a minute.
Free and open source under the MIT License.
pip install iso8583sim