Skip to main content

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.

QR Code Example


### Installation
  1. Install the library:
pip install custom_qr
  1. 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:

  1. 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, and ERROR_CORRECTION_LEVEL_L are not necessary if you do not want to specify the error correction level. 2. 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)
  1. 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. 4. 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)
  1. Display:
qr.display_qr(img)
  1. 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

custom_qr-0.9.4.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

custom_qr-0.9.4-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file custom_qr-0.9.4.tar.gz.

File metadata

  • Download URL: custom_qr-0.9.4.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

Hashes for custom_qr-0.9.4.tar.gz
Algorithm Hash digest
SHA256 1fa16d345317c70e751b2a2a6855c53d7ad541913797f69d53132b27a7376a7f
MD5 36a918c4eedc65286bcbaa287d0a8ab5
BLAKE2b-256 df3ed167c0d5ac57306df12e764e56192de740b39cb675d66e6fb8bd6bdb5266

See more details on using hashes here.

File details

Details for the file custom_qr-0.9.4-py3-none-any.whl.

File metadata

  • Download URL: custom_qr-0.9.4-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

Hashes for custom_qr-0.9.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1b32bd1cc4d645f9413f572a592bf4ef6b5faaa4410d3366a1f2059b2ff2a50d
MD5 0d71116688705e85813925b2f6795d70
BLAKE2b-256 5495ff34244e37bed9b791bd0aabd28e8beb6e388ec12fcf295eb7664403e2e6

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