Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync main to dev #12

Merged
merged 18 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.1.0
current_version = 0.1.1
commit = True
tag = True

Expand Down
53 changes: 35 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# This workflow contains a single job called "release"
release:
name: Create Release
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

strategy:
matrix:
Expand All @@ -31,29 +31,44 @@ jobs:
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
shell: bash

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Check out repository
uses: actions/checkout@v4

- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_depth: 10
version: ${{ steps.tag_name.outputs.current_version }}
path: ./CHANGELOG.md
# - name: Get Changelog Entry
# id: changelog_reader
# uses: mindsers/changelog-reader-action@v2
# with:
# validation_depth: 10
# version: ${{ steps.tag_name.outputs.current_version }}
# path: ./CHANGELOG.md

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-versions }}

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install project
run: poetry install -E doc --no-interaction

- name: build documentation
run: |
poetry install -E doc
poetry run mkdocs build

- name: publish documentation
Expand All @@ -72,11 +87,13 @@ jobs:

- name: create github release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: ${{ steps.changelog_reader.outputs.changes }}
token: ${{ secrets.PERSONAL_TOKEN }}
files: dist/*.whl
draft: false
prerelease: false
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.1.0 (2024-03-07)
## 0.1.0 (2024-03-15)

* First release on PyPI.


## 0.1.1 (2024-04-08)

* Increase max length of Purpose of Transaction
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# napas-qr
# Napas QR Python

[![pypi](https://img.shields.io/pypi/v/napas-qr-python.svg)](https://pypi.org/project/napas-qr-python/)
[![python](https://img.shields.io/pypi/pyversions/napas-qr-python.svg)](https://pypi.org/project/napas-qr-python/)
[![Build Status](https://github.com/shinxz12/napas-qr-python/actions/workflows/dev.yml/badge.svg)](https://github.com/shinxz12/napas-qr-python/actions/workflows/dev.yml)


Generate VietQR for python following VietQR [Vi Version](https://vietqr.net/portal-service/download/documents/QR_Format_T&C_v1.0_VN_092021.pdf)
and [En Version](https://vietqr.net/portal-service/download/documents/QR_Format_T&C_v1.5.2_EN_102022.pdf)

* Documentation: <https://shinxz12.github.io/napas-qr-python>
* GitHub: <https://github.com/shinxz12/napas-qr-python>
* PyPI: <https://pypi.org/project/napas-qr-python/>
* Free software: MIT

## Features

* VietQR code encoder.
Expand Down Expand Up @@ -40,7 +50,7 @@ qr_pay.generate_qr_pay()
```

<p align="center">
<img src="./resources/images/qr_code_base.png">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxAQAAAABb53yxAAABN0lEQVR42mP4DwYNDLjoD/L3Gt+wNzB8v56/TfZ7A8OXOP9tseJAOiDz0lQQHeeunisOkv9r8xco/0E0NDQEqP7/zyvb/UH6XQ2rhdY3MPzYLdX6tryB4VMz77SJ7xsY/hqamx0H8r9MO3pxOj9Qf2aubhaQ/zf66b5qoPyHZB+95/kNDH/uLswS6geKb4g7CtL/NfzplWB/oDmpMdNPAuX/uuRemCbfwPBx61F9LZB5YtXXLgHFv5h8FbsPpP/HbcwG618kdXAtUP7z1O6AeyB9vxW3RoLcw3q8cB7Q/k9LM/rLQPr7n367DzT/y3f/LeFA939jX1g1AWj+/w9xLenlIP+9vXdUH+jeW/5by0Hqg3MLBID6v4Qfa0sChU9AddjceqD8hW9954H2fBDbmJotjzt8oTQALM/W5aEFuuoAAAAASUVORK5CYII=">
</p>

* Generate code with a card service and amount:
Expand All @@ -58,7 +68,7 @@ qr_pay.generate_qr_pay()
```

<p align="center">
<img src="./resources/images/qr_code_card.png">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApAQAAAACAGz1bAAAA4UlEQVR42mP4DwINDFipD1KRU9gbGL7f3Lv3ewPDl4DYUHEgFbvbFkTFicYCqe+3tLYC5T6IhoYAVf7/bLUfqO8j6/3A+w0Mn8oW7VrfwPCb+2yZewPDT32O4/oNDH/kZaWvNzB8S/qyoh+oXSLTHsj7v6h5FlDlF+ErLseB+h6t+g3WdyekHCi4b9IqIO9X7L4QoMpfO36tym9g+Bpz1GU6UMmqlEXngaaIVQaEA035ZGEOtOGD4FVXe6DgNZntIHcGfbnADnJ1zurtIN7zUKAp3692ay8HqbwSGo7D7xAKAFDunMTKMVUkAAAAAElFTkSuQmCC">
</p>

* Generate QR code with custom styles following segno:
Expand All @@ -71,5 +81,5 @@ qr_pay.generate_qr_pay(dist=dist, styles=styles)
```

<p align="center">
<img src="./resources/images/qr_code_style.png">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFIAAABSAQMAAAD94hHYAAAABlBMVEUAAIv///+fga7nAAAA60lEQVR42rWTMWoGMAiFpa6BXEVwDXj1QFbBqwRcA9YupY1Zf6fw+CIv+gLxWxM+cgZUXotA5hf8qRBf5uZx68TAzoxVd7PuD/0gc9XFtalx6Q9JM1c/Eb2r/Xj+r2PaCUa/9SZDm6neuoFtl0F3/9UC5pZ28xsDHc1vfowWpHPevOAcq0fhQ9vsq/oh7E5E++bbaQnby79vJilztrPyRuE193KYih+1GYmPm2fe2Z7WzecoB2nb9b1DVmai7qv12es8AdGZuJc+PnCbPPKTc3aAR97GVrMHfyQDV/PG0zIQ8vBDmbjq/5P/7hvmnXQlddv3uQAAAABJRU5ErkJggg==">
</p>
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: napas_pay_qr
::: qr_pay
96 changes: 51 additions & 45 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool]
[tool.poetry]
name = "napas-qr-python"
version = "0.1.0"
version = "0.1.1"
homepage = "https://github.com/shinxz12/napas-qr-python"
description = "VietQR for python."
authors = ["shinxz12 <ngocbthe@gmail.com>"]
Expand Down Expand Up @@ -43,7 +43,7 @@ mkdocs = { version = "^1.1.2", optional = true}
mkdocs-include-markdown-plugin = { version = "^1.0.0", optional = true}
mkdocs-material = { version = "^6.1.7", optional = true}
mkdocstrings = { version = "^0.15.2", optional = true}
mkdocs-material-extensions = { version = "^1.0.1", optional = true}
mkdocs-material-extensions = { version = "^1.3.1", optional = true}
twine = { version = "^3.3.0", optional = true}
mkdocs-autorefs = {version = "^0.2.1", optional = true}
pre-commit = {version = "^2.12.0", optional = true}
Expand Down
2 changes: 1 addition & 1 deletion qr_pay/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = """shinxz12"""
__email__ = 'ngocbthe@gmail.com'
__version__ = '0.1.0'
__version__ = '0.1.1'


from .qr_pay import QRPay
4 changes: 3 additions & 1 deletion qr_pay/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ class TerminalLabel(Field):

class PurposeOfTransaction(Field):
id = "08"
max_length = 25
# max_length = 25
# Increasing the max length because some banks support more than the document max length
max_length = 90


class AdditionalConsumerDataRequest(Field):
Expand Down
Binary file removed resources/images/qr_code_base.png
Binary file not shown.
Binary file removed resources/images/qr_code_card.png
Binary file not shown.
Binary file removed resources/images/qr_code_style.png
Binary file not shown.
Loading