Python EMV QR Code encoder/decoder (currently only supports MPM).
| pykeris | Fix incorrect checksum on example and test_mpm | |
| .gitignore | Initial commit | |
| LICENSE | Initial commit | |
| pyproject.toml | Initial commit | |
| README.md | Fix incorrect checksum on example and test_mpm | |
| uv.lock | Initial commit | |
pykeris
Python EMV QR Code parser. The objective of this project is to provide a simple and flexible Python library that can facilitate EMV QR Code manipulation.
- Merchant-Presented Mode (MPM) v1.1
- Decoder
- Encoder
- Validator
- Customer-Presented Mode (CPM) v1.1
- Decoder
- Encoder
- Validator
Examples
Edit Merchant Name
>>> from pykeris import MerchantPresentedMode
>>> import pprint
>>> qr = MerchantPresentedMode.unpack('00020101021126700017ACQUIRER.LCAT.DEV0119936000082203821333702151912131509300050303UM\
E51460016DEV.LCAT.TESTING0215ID20190139613370303UME5204839853033605802ID5911Hello WOrld6009LOCALHOST61054017362070703A016304\
D3CC')
>>> pprint.pprint(list(enumerate(qr.root.value)))
[(0, DataObject(id_='00', value='01')),
(1, DataObject(id_='01', value='11')),
...
(7, DataObject(id_='59', value='Hello WOrld')),
...
>>> qr.root.value[7].value = 'Another merchant name test'
>>> qr.pack()
'00020101021126700017ACQUIRER.LCAT.DEV0119936000082203821333702151912131509300050303UME51460016DEV.LCAT.TESTING0215ID20190139613370303UME5204839853033605802ID5926Another merchant name test6009LOCALHOST61054017362070703A0163040397'
Add Transaction Amount
TODO.
Installation
pip install git+https://codeberg.org/fj/pykeris
Alternatives
This library is inspired from existing libraries
- Java, https://github.com/mvallim/emv-qrcode
- Python/Rust, https://github.com/krypton-byte/pyqris
Contribution
I would appreciate any contribution to this project.