Skip to main content

Python library to generate PromptPay QR Code

Project description

PromptPay

flake8 + pytest 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"

Reference

Project details


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.6.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

promptpay-1.1.6-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file promptpay-1.1.6.tar.gz.

File metadata

  • Download URL: promptpay-1.1.6.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for promptpay-1.1.6.tar.gz
Algorithm Hash digest
SHA256 cb94efb46102cb59ef28fb536eebc67d1270f757000a35cb8cb4ee36895bb3b0
MD5 a0bc9bd98ba305ace198554bfcb6fa97
BLAKE2b-256 972275c5707d6b2cf4b463e7356ae1174c11439f2e34346cb54bcd23e1c40f2b

See more details on using hashes here.

File details

Details for the file promptpay-1.1.6-py3-none-any.whl.

File metadata

  • Download URL: promptpay-1.1.6-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for promptpay-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8e991a02496345a75959f0ad439083cfdc413eb5ce180448d0bbd304a9b08379
MD5 29bbdcf23274ed511c1bbf796514c7e2
BLAKE2b-256 c328b69a14bda4871c753e2ffa7c8d7ca2413593cef3257f2499ecd9d215204a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page