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.8.tar.gz
(5.1 kB
view details)
Built Distribution
File details
Details for the file promptpay-1.1.8.tar.gz
.
File metadata
- Download URL: promptpay-1.1.8.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 | 8d86479aa3418021b6d50ef8b1e30b6ed6155aff84a7b74a744dda07f97f9d96 |
|
MD5 | 1823dec0b7a976c9490e0389f365bde1 |
|
BLAKE2b-256 | a31e78141efef830c721843514ee03f3a8b18d0644928bfb56fef514497e0339 |
File details
Details for the file promptpay-1.1.8-py3-none-any.whl
.
File metadata
- Download URL: promptpay-1.1.8-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 | 48862e664ead2c83a9e66b86229a210271a99bd8bc5167db16d18ed0794b372c |
|
MD5 | 906b3ec9bb41539881e7b593290bd36d |
|
BLAKE2b-256 | cfb41fc7183eb54fcf2d560a540d06f52b724ed41f2e09a134d46e5e873ea4f8 |