Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pyQR Code Generator

Overview

This CLI script turns a single URL into four PNG files that cover the L, M, Q, and H QR error correction levels using the Pillow-backed qrcode library. The tool validates that the URL already includes a scheme such as https:// and names each file based on the sanitized URL.

Requirements

  • Python 3.10 or newer

Setup

  1. Create a virtual environment: python3 -m venv .venv
  2. Activate it: source .venv/bin/activate
  3. Install the dependency: pip install 'qrcode[pil]'

Usage

Run the generator after activating the virtual environment.

Default output directory (current working directory):

python generate_qr_codes.py "https://example.com/path"

Custom directory using -o/--output-dir (created automatically):

python generate_qr_codes.py "https://example.com/path" -o output/qr

Notes

  • Filenames remove the scheme, drop slashes, and keep only letters, digits, dot, underscore, and dash. When nothing remains, the script falls back to qr-code.
  • Reactivate the .venv for future sessions with source .venv/bin/activate to reuse the installed dependency.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages