Skip to main content

Thai bank slip QR code parser

Project description

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/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thanakan_qr-0.1.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thanakan_qr-0.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file thanakan_qr-0.1.1.tar.gz.

File metadata

  • Download URL: thanakan_qr-0.1.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for thanakan_qr-0.1.1.tar.gz
Algorithm Hash digest
SHA256 18344e632a917832cbb96a69f63d0a1dce6e87c3b4c9f50361e8ddff8f3afc4b
MD5 c79d6d7629de79176dddc62971c39a71
BLAKE2b-256 11948ea310393023026de7ce8330837ced0e86db16d40ae3413377670c29783c

See more details on using hashes here.

File details

Details for the file thanakan_qr-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: thanakan_qr-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for thanakan_qr-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d2cd17d5c6ddd0c8695d8600c3607a4a9906f564757a0fa3c7dd8d60d08869f9
MD5 d8f3c7a7ef2618a6480fd3e2250d31d9
BLAKE2b-256 76b5200069606ef54a0e4bfb987d5709a86b12781b8f118106ac7c206a9ba179

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page