High-performance ISO 8583 message simulator with CLI, Python SDK, and LLM features
Project description
ISO8583 Simulator
A modern, high-performance ISO 8583 message simulator with CLI, Python SDK, and interactive Jupyter notebooks.
Features
-
Message Handling:
- Parse ISO 8583 messages (180k+ TPS with Cython)
- Build ISO 8583 messages (150k+ TPS)
- Validate message structure and content
- Support for ISO versions (1987, 1993, 2003)
-
Network Support:
- VISA, Mastercard, AMEX, Discover, JCB, UnionPay
- Network-specific field validation
- EMV/chip card data handling (Field 55)
-
Multiple Interfaces:
- Command Line Interface (CLI)
- Python SDK for programmatic usage
- Interactive Jupyter notebooks
-
Performance Optimized:
- Optional Cython extensions for 2x speedup
- Object pooling for high-throughput scenarios
- See Performance Guide
Installation
pip install iso8583sim
# For Cython performance extensions
pip install iso8583sim[perf]
python setup.py build_ext --inplace
Quick Start
Python SDK
from iso8583sim.core.parser import ISO8583Parser
from iso8583sim.core.builder import ISO8583Builder
from iso8583sim.core.validator import ISO8583Validator
from iso8583sim.core.types import ISO8583Message
# Build a message
builder = ISO8583Builder()
message = ISO8583Message(
mti="0100",
fields={
0: "0100",
2: "4111111111111111",
3: "000000",
4: "000000001000",
11: "123456",
41: "TERM0001",
42: "MERCHANT123456 ",
}
)
raw = builder.build(message)
# Parse a message
parser = ISO8583Parser()
parsed = parser.parse(raw)
# Validate a message
validator = ISO8583Validator()
errors = validator.validate_message(parsed)
CLI Usage
# Parse a message
iso8583sim parse "0100..." --version 1987
# Build a message
iso8583sim build --mti 0100 --fields fields.json
# Validate a message
iso8583sim validate "0100..."
# Generate sample messages
iso8583sim generate --type auth --pan 4111111111111111 --amount 1000
Interactive Notebooks
Learn ISO 8583 with our Jupyter notebooks:
| Notebook | Description |
|---|---|
| 01_getting_started.ipynb | Basic concepts and quick start |
| 02_parsing_messages.ipynb | Deep dive into message parsing |
| 03_building_messages.ipynb | Building various message types |
| 04_network_specifics.ipynb | VISA, Mastercard, and other networks |
| 05_emv_data.ipynb | Working with EMV/chip card data |
| 06_benchmarking.ipynb | Performance testing and benchmarks |
Run locally:
pip install jupyter
jupyter notebook notebooks/
Performance
Benchmarks on Apple Silicon (M-series), Python 3.12:
| Operation | Pure Python | With Cython |
|---|---|---|
| Parse | ~105k TPS | ~182k TPS |
| Build | ~150k TPS | ~150k TPS |
| Roundtrip | ~49k TPS | ~63k TPS |
See benchmarks/BASELINE.md for detailed results.
Documentation
Full documentation is available at iso8583.subhadipmitra.com
- Getting Started - Quick start guide
- Architecture - System design and decisions
- API Reference - Complete API documentation
- Performance Guide - Optimization techniques
Development
# Clone and setup
git clone https://github.com/bassrehab/ISO8583-Simulator.git
cd iso8583sim
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
# Run tests
pytest
# Run benchmarks
python benchmarks/bench_parser.py
python benchmarks/bench_roundtrip.py
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/my-feature) - Create a Pull Request
Author
Subhadip Mitra - subhadipmitra.com
- GitHub: @bassrehab
- LinkedIn: subhadipmitra
License
MIT License - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
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 iso8583sim-1.1.0.tar.gz.
File metadata
- Download URL: iso8583sim-1.1.0.tar.gz
- Upload date:
- Size: 127.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e66e523205721006331a7ee50e0e8c77700a58afd73376dafef5509b360aae1
|
|
| MD5 |
2a5013a77bb4507ee202b819cd343e2d
|
|
| BLAKE2b-256 |
7a49dc370126919ede0148cc6154c166e888274668a01fde643a73f4242a78a2
|
Provenance
The following attestation bundles were made for iso8583sim-1.1.0.tar.gz:
Publisher:
publish.yml on bassrehab/ISO8583-Simulator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iso8583sim-1.1.0.tar.gz -
Subject digest:
4e66e523205721006331a7ee50e0e8c77700a58afd73376dafef5509b360aae1 - Sigstore transparency entry: 782206829
- Sigstore integration time:
-
Permalink:
bassrehab/ISO8583-Simulator@9b72eef58a2a3213d35255972f58fe51494dc05d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bassrehab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b72eef58a2a3213d35255972f58fe51494dc05d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file iso8583sim-1.1.0-py3-none-any.whl.
File metadata
- Download URL: iso8583sim-1.1.0-py3-none-any.whl
- Upload date:
- Size: 61.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b24099a3a5e0e428085505698b00ade9077dda40ddade7a8127df10818e980e
|
|
| MD5 |
17f7d97214f1ddd07720de22c8b0278d
|
|
| BLAKE2b-256 |
ee58b5658f662cf46ae78edb5e9cd178a62955e925a3925e4e927361246f4044
|
Provenance
The following attestation bundles were made for iso8583sim-1.1.0-py3-none-any.whl:
Publisher:
publish.yml on bassrehab/ISO8583-Simulator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iso8583sim-1.1.0-py3-none-any.whl -
Subject digest:
2b24099a3a5e0e428085505698b00ade9077dda40ddade7a8127df10818e980e - Sigstore transparency entry: 782206832
- Sigstore integration time:
-
Permalink:
bassrehab/ISO8583-Simulator@9b72eef58a2a3213d35255972f58fe51494dc05d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bassrehab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b72eef58a2a3213d35255972f58fe51494dc05d -
Trigger Event:
workflow_dispatch
-
Statement type: