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.

Installation

  1. Install the library:

    pip install custom_qr
    
  2. 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)
    
  3. 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)
    
  5. Display:

    qr.display_qr(img)
    
  6. 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.2.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: custom_qr-0.9.2.tar.gz
  • Upload date:
  • Size: 15.2 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.2.tar.gz
Algorithm Hash digest
SHA256 ae5fa97b4bf326a85e5d134359881b544df52543ee2eaa0c5cd2a9b4956acd55
MD5 2b016126817219ea9bf5d718229b8733
BLAKE2b-256 4f39a508a2eb7ed563aad9e43fec9e073627fea54be28bf3fb2f9435066beff9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: custom_qr-0.9.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c76d6ffe214d680a0a105abc9154df91d1b58f91431c285ac33f861354eca84d
MD5 439f752554b2432471e2344ae4e1d801
BLAKE2b-256 3395423fb00ddf73b5eff0cb64a21ce658733e7fe57d28cb29478c4c27be87f4

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