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"
Development
# Conda env
conda create --name promptpay3.10 python=3.10.4
conda activate promptpay3.10
conda create --name promptpay3.7 python=3.7.13
conda activate promptpay3.7
conda remove --name promptpay3.10 --all
# others
pip install -r requirements.txt
pip install -r requirements-dev.txt
python -m flake8 --ignore=E501 promptpay tests
python -m pytest tests --cov=./ --cov-report=xml
pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
python -m pip list --format=freeze > requirements-tmp.txt
pip install libscrc==
pip install Pillow==
pip install promptpay
pip install promptpay==1.1.7
pip install .
pip install --force-reinstall promptpay
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.9.tar.gz
(5.1 kB
view details)
Built Distribution
File details
Details for the file promptpay-1.1.9.tar.gz
.
File metadata
- Download URL: promptpay-1.1.9.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 874d0f8d5fe48da7637787d78a7c707d4abc2fcb70814927d16613702245f20f |
|
MD5 | debcaa3dbaeba7954189fdd59bee8edb |
|
BLAKE2b-256 | 60163f01f4642433cceac7412c3ca8c0ae515be6e5bbd14d5c9408248bfeb647 |
File details
Details for the file promptpay-1.1.9-py3-none-any.whl
.
File metadata
- Download URL: promptpay-1.1.9-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cb880a1ec9e028ff66285cd37c291069fc0afb5d59cc8550520f284a76d42bd |
|
MD5 | f2c2856adb9c11ef618fca9b5cfd0858 |
|
BLAKE2b-256 | 2700d94472a43b09e4614da2ef71948f5fbad8961f0a13c9d3c8eea29743383b |