Skip to main content

PromptPay

continuous-integration continuous-delivery runnable runnable-cli PyPI version fury.io License: MIT codecov

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

Release files for promptpay 1.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for promptpay 1.1.9
File Size Uploaded
promptpay-1.1.9.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for promptpay 1.1.9
File Interpreter ABI Platform
promptpay-1.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / promptpay-1.1.9.tar.gz

Download URL promptpay-1.1.9.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
874d0f8d5fe48da7637787d78a7c707d4abc2fcb70814927d16613702245f20f
BLAKE2b-256 checksum
How to use checksums
60163f01f4642433cceac7412c3ca8c0ae515be6e5bbd14d5c9408248bfeb647
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release files / promptpay-1.1.9-py3-none-any.whl

Download URL promptpay-1.1.9-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cb880a1ec9e028ff66285cd37c291069fc0afb5d59cc8550520f284a76d42bd
BLAKE2b-256 checksum
How to use checksums
2700d94472a43b09e4614da2ef71948f5fbad8961f0a13c9d3c8eea29743383b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release history Release notifications | RSS feed

This release

1.1.9 This release

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page