Skip to main content

thanakan-qr

Thai bank slip QR code parser following the SCB specification.

Installation

pip install thanakan-qr

System Dependencies

QR parsing requires libzbar:

# Ubuntu/Debian
sudo apt-get install libzbar0

# macOS
brew install zbar

Usage

Parse from image

from PIL import Image
from thanakan_qr import SlipQRData

image = Image.open("slip.png")
data = SlipQRData.create_from_image(image)

print(f"Sending Bank: {data.payload.sending_bank_id}")
print(f"Transaction Ref: {data.payload.transaction_ref_id}")

Parse from QR string

from thanakan_qr import SlipQRData

data = SlipQRData.create_from_code("00520102...")
print(data.model_dump_json(indent=2))

API

SlipQRData

  • SlipQRData.create_from_image(image) - Parse QR from PIL Image
  • SlipQRData.create_from_code(code) - Parse QR from string

Exceptions

  • not_bank_slip - Raised when QR is not a valid bank slip
  • expect_single_qrcode - Raised when image has zero or multiple QR codes

Bank Codes

Code Bank
002 Bangkok Bank (BBL)
004 Kasikorn Bank (KBank)
006 Krung Thai Bank (KTB)
011 TMBThanachart (TTB)
014 Siam Commercial Bank (SCB)
025 Bank of Ayudhya (BAY)

Documentation

Full documentation: https://ninyawee.github.io/thanakan/libraries/thanakan-qr/

Metadata

Release files for thanakan-qr 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thanakan-qr 0.2.0
File Size Uploaded Provenance
thanakan_qr-0.2.0.tar.gz 2.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for thanakan-qr 0.2.0
File Interpreter ABI Platform
thanakan_qr-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.0 kB

Release files / thanakan_qr-0.2.0.tar.gz

Download URL thanakan_qr-0.2.0.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
814ef167bc53b01b2fbe77bda6282f59c5aa0e47ba42e04f8acf1d8a9bf36cd6
BLAKE2b-256 checksum
How to use checksums
e508ce8f2f2ae891ff9a329284e9379a27fa6295f4517280689e362e797584f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / thanakan_qr-0.2.0-py3-none-any.whl

Download URL thanakan_qr-0.2.0-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2aa215f38e80474851e6be259bc0dc29209e70dd5cf04a314d312461e6a34d25
BLAKE2b-256 checksum
How to use checksums
ffeb5d6b4dde01a2f2021b6159d71e123dad0ebd487eb30dce8bb69f18b1e39f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for thanakan-qr 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page