thai-qr-payment
Generate QR Code image in the format of Thai QR Payment
Installation
available on pip https://pypi.org/project/thaiqrpayment/
pip install thaiqrpayment
Usage
import thaiqrpayment
# Your code from Bank
code = "01" * 100
# Save to image file
thaiqrpayment.save(code, "/tmp/qr.png")
# Save QR with custom text (text overlays ON QR code for security)
thaiqrpayment.save(code, "/tmp/qr_with_text.png", insert_text="Online Gaming Only")
# Save QR specifically for gaming (with "Online Gaming Only" text)
thaiqrpayment.save_gaming_qr(code, "/tmp/gaming_qr.png")
# SECURE ANTI-FRAUD QR CODES (text cannot be easily removed)
# Level 2 Security: Text overlay on QR code area
thaiqrpayment.save_secure_gaming_qr(code, "/tmp/secure_gaming.png")
# Level 3 Security: Text embedded in QR pattern (maximum security)
thaiqrpayment.save_embedded_gaming_qr(code, "/tmp/embedded_gaming.png")
# Custom secure QR with warning text
secure_img = thaiqrpayment.generate_secure_qr(code, "NOT FOR REAL PAYMENT")
secure_img.save("/tmp/warning_qr.png")
# Custom embedded QR (text integrated into QR pattern)
embedded_img = thaiqrpayment.generate_embedded_watermark_qr(code, "DEMO ONLY")
embedded_img.save("/tmp/demo_qr.png")
# base64 format
base64_str = thaiqrpayment.to_base64(code)
# base64 format with security
base64_secure = thaiqrpayment.secure_gaming_qr_to_base64(code)
base64_embedded = thaiqrpayment.embedded_gaming_qr_to_base64(code)
# PIL image
pil_image = thaiqrpayment.generate(code)
# PIL image with custom text overlay
pil_image = thaiqrpayment.generate(code, insert_text="Online Gaming Only")
# PIL image for gaming
pil_image = thaiqrpayment.generate_gaming_qr(code)
Security Features
Anti-Fraud Protection Levels
- Level 1 - Standard Text: Text appears below QR code (can be cropped)
- Level 2 - Secure Overlay: Text overlays on QR code area (harder to remove)
- Level 3 - Embedded Watermark: Text integrated into QR pattern (cannot be removed)
Use Cases
- Gaming Payments: Use
save_embedded_gaming_qr()for maximum security - Demo/Test QRs: Use
generate_secure_qr()to prevent misuse - Invalid QRs: Use embedded warnings that cannot be removed
- Custom Warnings: Add specific text to prevent unauthorized use
Example Image
Metadata
Release files for thaiqr-gaming 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| thaiqr_gaming-0.3.0.tar.gz | 43.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| thaiqr_gaming-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 84.5 kB
Release files / thaiqr_gaming-0.3.0.tar.gz
| Download URL | thaiqr_gaming-0.3.0.tar.gz |
|---|---|
| Size | 43.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
319065f76ea4fecc21c083b9e8f098b6358775ed46a87cb7a22f11234744503e
|
|
BLAKE2b-256 checksum How to use checksums |
9f490da4cffb4071a7afdc69cffb54340451ff4c6c2177ebd894a5a0a408604a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.4
|
Release files / thaiqr_gaming-0.3.0-py3-none-any.whl
| Download URL | thaiqr_gaming-0.3.0-py3-none-any.whl |
|---|---|
| Size | 41.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f396f89ffcc4663d9f5d735acf9e4532f0916e454dec2a2e23cfd8039227fbc6
|
|
BLAKE2b-256 checksum How to use checksums |
023946405a858f6172a24bc985cbff2a4901a4577ef5743a9c6799f25128e38d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.4
|