Small utility to generate SVG and PNG QR codes from a set of URLs.
This repository contains a tiny Python script that uses segno to create
vector (SVG) and raster (PNG) QR codes and writes them into the qrcodes/
directory inside the project.
generate_qrcodes.py— main script. Edit theURLSmapping to change which QR codes are produced.requirements.txt— runtime dependencies for the project.LICENSE— license for this repository.qrcodes/— output folder where SVG and PNG files are written.
- Create a virtual environment (recommended) and install dependencies:
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt-
Edit
generate_qrcodes.pyand update theURLSdictionary with the keys (used as filenames) and values (the target URLs). -
Run the script from the project root:
python generate_qrcodes.py- Deactivate venv
deactivate- Find generated files in the
qrcodes/folder. Each entry produces both an SVG and a PNG file.
SCALE— controls the size of the generated PNG files (pixel multiplier).BORDER— quiet zone for the QR code (number of modules).
Open generate_qrcodes.py for more details and to adjust parameters.
Dependencies are listed in requirements.txt. The script uses:
- segno — QR code generator (pure Python)
- Pillow — used by segno to write PNG files
Install them with pip install -r requirements.txt (see Quickstart above).
This project is covered by the terms in the LICENSE file in this repository.
See: LICENSE.