Giter Club home page Giter Club logo

promptpay's Introduction

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.9 python=3.9.12
conda activate promptpay3.9
conda create --name promptpay3.7 python=3.7.13
conda activate promptpay3.7
conda remove --name promptpay3.10 --all
conda search python

# others
python -V
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

promptpay's People

Contributors

jojoee avatar poonlap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.