1
0
Fork
You've already forked pykeris
0
Python EMV QR Code encoder/decoder (currently only supports MPM).
  • Python 100%
2025年11月20日 18:41:40 +08:00
pykeris Fix incorrect checksum on example and test_mpm 2025年11月20日 18:41:40 +08:00
.gitignore Initial commit 2025年11月20日 16:59:01 +08:00
LICENSE Initial commit 2025年11月20日 16:59:01 +08:00
pyproject.toml Initial commit 2025年11月20日 16:59:01 +08:00
README.md Fix incorrect checksum on example and test_mpm 2025年11月20日 18:41:40 +08:00
uv.lock Initial commit 2025年11月20日 16:59:01 +08:00

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.

  1. Merchant-Presented Mode (MPM) v1.1
    1. Decoder
    2. Encoder
    3. Validator
  2. Customer-Presented Mode (CPM) v1.1
    1. Decoder
    2. Encoder
    3. 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

  1. Java, https://github.com/mvallim/emv-qrcode
  2. Python/Rust, https://github.com/krypton-byte/pyqris

Contribution

I would appreciate any contribution to this project.