Skip to main content

QR platba SVG QR code and SPAYD string generator.

Project description

python-qrplatba

https://badge.fury.io/py/qrplatba.png

Python library for generating QR codes for QR platba.

https://raw.github.com/viktorstiskala/python-qrplatba/gh-pages/example.png

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.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 and border parameters
  • Changed legacy setuptools to poetry
  • Dropped support for Python 2.x and <3.7
  • Changed license to MIT
  • Added unit tests

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

qrplatba-1.0.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

qrplatba-1.0.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file qrplatba-1.0.0.tar.gz.

File metadata

  • Download URL: qrplatba-1.0.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.2 Linux/5.15.0-1034-azure

File hashes

Hashes for qrplatba-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3d29dae28de71f41e69229400e0297a0f3b9c6121e2dc7de9c50800994d3c99a
MD5 a89cc71dcc73c4cbab9e4440f82811d7
BLAKE2b-256 fb8b789522183379edf0b69cc7e60b433ec97689ce8abd3eb0297f8a9f56dc2d

See more details on using hashes here.

File details

Details for the file qrplatba-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: qrplatba-1.0.0-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.2 Linux/5.15.0-1034-azure

File hashes

Hashes for qrplatba-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 830835d850496f53eba1c41462945b9c9121f35655ca6b079fc5c1a90b57a7d8
MD5 e8b2bf54323834800edf333ad77db71d
BLAKE2b-256 cdd10ba2dd9acea333d11996ca43957260f7a75394cf5ea76458a2329022ef01

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