Generate and customize QR codes
Project description
custom_qr Library
This library provides functionality to generate QR codes and a wide variety of options to customize them.
Installation
-
Install the library:
pip install custom_qr
-
Verify Installation:
pip list
NOTE: It is recommended to use a virtual environment.
Usage
Here's how you can use the library to generate QR codes and customize them:
-
Import the library:
from custom_qr import QrCode from custom_qr import ( ERROR_CORRECTION_LEVEL_H, ERROR_CORRECTION_LEVEL_Q, ERROR_CORRECTION_LEVEL_M, ERROR_CORRECTION_LEVEL_L )
Note: The constants
ERROR_CORRECTION_LEVEL_H
,ERROR_CORRECTION_LEVEL_Q
,ERROR_CORRECTION_LEVEL_M
, andERROR_CORRECTION_LEVEL_L
are not necessary if you do not want to specify the error correction level. -
Create a QR Code:
qr = QrCode() matrix, version = qr.generate("https://www.qrcode.com/")
To specify a version and/or an error correction level:
qr = QrCode() matrix, version = qr.generate("https://www.qrcode.com/", version=6, error_correction=ERROR_CORRECTION_LEVEL_Q)
-
Print on Console:
qr.print_qr_console(matrix)
Note: The QR code printed on the console is not scannable. To get a working version, display it on screen or save it to a file.
-
Get Image Version: To display on screen, it's important to get the image version of the QR code. The image version is needed for all customization functions and to save to a file:
img = qr.create_qr_image(matrix)
-
Display:
qr.display_qr(img)
-
Save Image:
qr.create_image_file(img, filename="qr.png")
Note: The default filename is "qr.png".
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
Built Distribution
File details
Details for the file custom_qr-0.9.3.tar.gz
.
File metadata
- Download URL: custom_qr-0.9.3.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08b9389948f4c2e3bd5ff94d9bc5dac18d990d6de9c2901a40babce6c428d568 |
|
MD5 | 492b03adfa9c82c70a7acd221c0380c6 |
|
BLAKE2b-256 | 082411b0752234e889cebd905da6ca5d1538f35f0df015b8a3f984fdf34afb8c |
File details
Details for the file custom_qr-0.9.3-py3-none-any.whl
.
File metadata
- Download URL: custom_qr-0.9.3-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28e5a0a3d5e74f3b58373071c073ef61e76809c06c872a42ba3996139747622b |
|
MD5 | d79689a8fe7fd9133387cb4cf5c2ab23 |
|
BLAKE2b-256 | 8cd71a7122cf16dd5b6425168ee416ef93046ee7f9f2b9c4984d02aec29d0870 |