promptpay


Namepromptpay JSON
Version 1.1.9 PyPI version JSON
download
home_pagehttps://github.com/jojoee/promptpay
SummaryPython library to generate PromptPay QR Code
upload_time2022-06-30 05:17:59
maintainer
docs_urlNone
authorNathachai Thongniran
requires_python
licenseMIT
keywords promptpay qrcode
VCS
bugtrack_url
requirements libscrc Pillow qrcode
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PromptPay

![continuous-integration](https://github.com/jojoee/promptpay/workflows/continuous-integration/badge.svg?branch=master)
![continuous-delivery](https://github.com/jojoee/promptpay/workflows/continuous-delivery/badge.svg?branch=master)
![runnable](https://github.com/jojoee/promptpay/workflows/runnable/badge.svg?branch=master)
![runnable-cli](https://github.com/jojoee/promptpay/workflows/runnable-cli/badge.svg?branch=master)
[![PyPI version fury.io](https://badge.fury.io/py/promptpay.svg)](https://pypi.python.org/pypi/promptpay/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![codecov](https://codecov.io/gh/jojoee/promptpay/branch/master/graph/badge.svg)](https://codecov.io/gh/jojoee/promptpay)

Python library to generate PromptPay QR Code, inspired from [dtinth/promptpay-qr](https://github.com/dtinth/promptpay-qr)

## Installation

```
pip install promptpay

# or
git clone https://github.com/jojoee/promptpay
cd promptpay
python setup.py install
```

## Usage

### Library

```python
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

```bash
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

```bash
# 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

- [มีอะไรอยู่ใน PromptPay QR แกะสเปค QR ที่จะใช้จ่ายผ่าน mobile banking ได้ทุกธนาคารในอนาคต](https://www.blognone.com/node/95133)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jojoee/promptpay",
    "name": "promptpay",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "promptpay,qrcode",
    "author": "Nathachai Thongniran",
    "author_email": "inid3a@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/60/16/3f01f4642433cceac7412c3ca8c0ae515be6e5bbd14d5c9408248bfeb647/promptpay-1.1.9.tar.gz",
    "platform": null,
    "description": "# PromptPay\n\n![continuous-integration](https://github.com/jojoee/promptpay/workflows/continuous-integration/badge.svg?branch=master)\n![continuous-delivery](https://github.com/jojoee/promptpay/workflows/continuous-delivery/badge.svg?branch=master)\n![runnable](https://github.com/jojoee/promptpay/workflows/runnable/badge.svg?branch=master)\n![runnable-cli](https://github.com/jojoee/promptpay/workflows/runnable-cli/badge.svg?branch=master)\n[![PyPI version fury.io](https://badge.fury.io/py/promptpay.svg)](https://pypi.python.org/pypi/promptpay/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![codecov](https://codecov.io/gh/jojoee/promptpay/branch/master/graph/badge.svg)](https://codecov.io/gh/jojoee/promptpay)\n\nPython library to generate PromptPay QR Code, inspired from [dtinth/promptpay-qr](https://github.com/dtinth/promptpay-qr)\n\n## Installation\n\n```\npip install promptpay\n\n# or\ngit clone https://github.com/jojoee/promptpay\ncd promptpay\npython setup.py install\n```\n\n## Usage\n\n### Library\n\n```python\nfrom promptpay import qrcode\n\n# generate a payload\nid_or_phone_number = \"0841234567\"\npayload = qrcode.generate_payload(id_or_phone_number)\npayload_with_amount = qrcode.generate_payload(id_or_phone_number, 1.23)\n\n# export to PIL image\nimg = qrcode.to_image(payload)\n\n# export to file\nqrcode.to_file(payload, \"./qrcode-0841234567.png\")\nqrcode.to_file(payload_with_amount, \"/Users/joe/Downloads/qrcode-0841234567.png\") \n```\n\n### CLI\n\n```bash\npython -m promptpay qrcode --id=\"0841234567\"\npython -m promptpay qrcode --id=\"0841234567\" --file=\"./qrcode-cli.png\"\npython -m promptpay qrcode --id=\"0841234567\" --show=true\npython -m promptpay qrcode \\\n  --id=\"0841234567\" \\\n  --amount=2.34 \\\n  --file=\"/Users/joe/Downloads/qrcode-cli-with-amount.png\"\n```\n\n## Development\n\n```bash\n# Conda env\nconda create --name promptpay3.10 python=3.10.4\nconda activate promptpay3.10\nconda create --name promptpay3.7 python=3.7.13\nconda activate promptpay3.7\nconda remove --name promptpay3.10 --all\n\n# others\npip install -r requirements.txt\npip install -r requirements-dev.txt\npython -m flake8 --ignore=E501 promptpay tests\npython -m pytest tests --cov=./ --cov-report=xml\npip list --outdated --format=freeze | grep -v '^\\-e' | cut -d = -f 1  | xargs -n1 pip install -U\npython -m pip list --format=freeze > requirements-tmp.txt\npip install libscrc==\npip install Pillow==\npip install promptpay\npip install promptpay==1.1.7\npip install .\npip install --force-reinstall promptpay\n```\n\n## Reference\n\n- [\u0e21\u0e35\u0e2d\u0e30\u0e44\u0e23\u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19 PromptPay QR \u0e41\u0e01\u0e30\u0e2a\u0e40\u0e1b\u0e04 QR \u0e17\u0e35\u0e48\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e08\u0e48\u0e32\u0e22\u0e1c\u0e48\u0e32\u0e19 mobile banking \u0e44\u0e14\u0e49\u0e17\u0e38\u0e01\u0e18\u0e19\u0e32\u0e04\u0e32\u0e23\u0e43\u0e19\u0e2d\u0e19\u0e32\u0e04\u0e15](https://www.blognone.com/node/95133)\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python library to generate PromptPay QR Code",
    "version": "1.1.9",
    "split_keywords": [
        "promptpay",
        "qrcode"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "f2c2856adb9c11ef618fca9b5cfd0858",
                "sha256": "7cb880a1ec9e028ff66285cd37c291069fc0afb5d59cc8550520f284a76d42bd"
            },
            "downloads": -1,
            "filename": "promptpay-1.1.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f2c2856adb9c11ef618fca9b5cfd0858",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5843,
            "upload_time": "2022-06-30T05:17:57",
            "upload_time_iso_8601": "2022-06-30T05:17:57.846321Z",
            "url": "https://files.pythonhosted.org/packages/27/00/d94472a43b09e4614da2ef71948f5fbad8961f0a13c9d3c8eea29743383b/promptpay-1.1.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "debcaa3dbaeba7954189fdd59bee8edb",
                "sha256": "874d0f8d5fe48da7637787d78a7c707d4abc2fcb70814927d16613702245f20f"
            },
            "downloads": -1,
            "filename": "promptpay-1.1.9.tar.gz",
            "has_sig": false,
            "md5_digest": "debcaa3dbaeba7954189fdd59bee8edb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5139,
            "upload_time": "2022-06-30T05:17:59",
            "upload_time_iso_8601": "2022-06-30T05:17:59.427336Z",
            "url": "https://files.pythonhosted.org/packages/60/16/3f01f4642433cceac7412c3ca8c0ae515be6e5bbd14d5c9408248bfeb647/promptpay-1.1.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-06-30 05:17:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "jojoee",
    "github_project": "promptpay",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "libscrc",
            "specs": []
        },
        {
            "name": "Pillow",
            "specs": []
        },
        {
            "name": "qrcode",
            "specs": []
        }
    ],
    "lcname": "promptpay"
}
        
Elapsed time: 0.01198s