QR Code image generator with customizable image formats, error correction levels, and styling options
Create a utility that generates QR codes for URLs with customization options.
Build a Python function that takes a URL string and generates a QR code image file. The function should support error correction levels and color customization.
Implement a function generate_url_qrcode(url, output_path, **options) that:
The function should accept these optional parameters via **options:
error_correction: Error correction levelfill_color: Foreground color for QR modules (default: "black")back_color: Background color (default: "white")When called with only url and output_path, the function should generate a basic QR code with default settings.
Provides QR code generation functionality.
Input:
"https://example.com""test_qrcode.png"Expected Behavior:
test_qrcode.png is created"https://example.com"Test file: test_qrcode_generator.py
Input:
"https://github.com""colored_qrcode.png"fill_color="blue", back_color="yellow"Expected Behavior:
colored_qrcode.png is created with blue modules on a yellow backgroundTest file: test_qrcode_generator.py
Input:
"https://www.example.org/page""high_ec_qrcode.png"error_correction set to highest levelExpected Behavior:
high_ec_qrcode.png is created with high error correctionTest file: test_qrcode_generator.py
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10