Python library to generate PromptPay QR Code
Project description
PromptPay
Python library to generate PromptPay QR Code, inspired from dtinth/promptpay-qr
Installation
pip install promptpay
# or
git clone https://github.com/jojoee/promptpay
cd promptpay
python setup.py install
Usage
Library
from promptpay import qrcode
# generate a payload
id_or_phone_number = "0841234567"
payload = qrcode.generate_payload(id_or_phone_number)
payload_with_amount = qrcode.generate_payload(id_or_phone_number, 1.23)
# export to PIL image
img = qrcode.to_image(payload)
# export to file
qrcode.to_file(payload, "./qrcode-0841234567.png")
qrcode.to_file(payload_with_amount, "/Users/joe/Downloads/qrcode-0841234567.png")
CLI
python -m promptpay qrcode --id="0841234567"
python -m promptpay qrcode --id="0841234567" --file="./qrcode-cli.png"
python -m promptpay qrcode --id="0841234567" --amount=2.34 --file="/Users/joe/Downloads/qrcode-cli-with-amount.png"
Reference
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
promptpay-1.1.4.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for promptpay-1.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa7a09a345b9cbecacd053fbaf57455d913d369c240d7a4d15ae721a06d15511 |
|
MD5 | 5c3efbcbe621b62b1602ba32e44b13ef |
|
BLAKE2b-256 | 8731c4eb09f2c9d1af16427f10dbd583bd933cf6e717cb7b7b871b44dfe84588 |