QR platba SVG QR code and SPAYD string generator.
Project description
python-qrplatba
Python library for generating QR codes for QR platba.
See http://qr-platba.cz/pro-vyvojare/ for more information about the specification (available only in czech).
from qrplatba import QRPlatbaGenerator
from datetime import datetime, timedelta
due = datetime.now() + timedelta(days=14)
generator = QRPlatbaGenerator('123456789/0123', 400.56, x_vs=2034456, message='text', due_date=due)
img = generator.make_image()
img.save('example.svg')
# optional: custom box size and border
img = generator.make_image(box_size=20, border=4)
# optional: get SVG as a string.
# Encoding has to be 'unicode', otherwise it will be encoded as bytes
svg_data = img.to_string(encoding='unicode')
Installation
To install qrplatba, simply:
$ pip install qrplatba
Note on image file formats
This module generates SVG file which is an XML-based vector image format. You can use various libraries and/or utilities to convert it to other vector or bitmap image formats. Below is an example how to use libRSVG
to convert SVG images.
libRSVG
libRSVG
renders SVG files using cairo and supports many output image formats. It can also be used directly in console with rsvg-convert
command.
$ rsvg-convert -f pdf example.svg -o example.pdf
License
This software is licensed under MIT license since version 1.0.0
.
Changelog
1.1.0
(5 April 2023)
- Dropped support for Python 3.7
- Added pre-commit, black and ruff for code formatting
1.0.0
(4 April 2023)
Warning: While the API is mostly backwards compatible, the look and size of the generated QR codes has changed.
- Updated requirements to support the latest
qrcode
version - Added support for custom output sizes using
box_size
andborder
parameters - Changed legacy setuptools to poetry
- Dropped support for Python
2.x
and<3.7
- Changed license to MIT
- Added unit tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file qrplatba-1.1.1.tar.gz
.
File metadata
- Download URL: qrplatba-1.1.1.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Linux/5.15.0-1035-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1116908445d660006b500ebc2dd97ade1ef4c7892f63f3b67c02d85b3d63f233 |
|
MD5 | 68607d190ef82640dc1a0eb6d1b36774 |
|
BLAKE2b-256 | 839bf29ff5eff8066cc866a3bb0c6b2dad831d00d5e9b660a3d960d505060ec9 |
File details
Details for the file qrplatba-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: qrplatba-1.1.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Linux/5.15.0-1035-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba4bd8558c92dbe916938bb6e5dda7eafa620c0bc5ba1922ed6c370525f44d67 |
|
MD5 | ed6658aef0cfe434c06c418d4b875467 |
|
BLAKE2b-256 | 1945f9894270040192a730e37d51e90da721ddd7c4c6d6eace1fcbb16edfaaf0 |