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" --show=true
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.5.tar.gz
(4.2 kB
view details)
Built Distribution
File details
Details for the file promptpay-1.1.5.tar.gz
.
File metadata
- Download URL: promptpay-1.1.5.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ee4ff52365728c8560f185378a459e8ab3aea72b3bc8d102816aa4e203de523 |
|
MD5 | 1267ba542dab7ffbaa53d456ca4287ae |
|
BLAKE2b-256 | 22b31e0747c45aac25cb03b8859cb918f6c0aa497759ed28981d6d78a476c18a |
File details
Details for the file promptpay-1.1.5-py3-none-any.whl
.
File metadata
- Download URL: promptpay-1.1.5-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 538464d877c629c22ec6ce938b981ec5ccfab0099fa8253a983734d2fc500224 |
|
MD5 | 725e3ae049fd9ef17cbc806d71cfd27b |
|
BLAKE2b-256 | 1096702c800bba494715a68f59b23377853c3d67af6f33e12daceb7d637eeaed |