#!/usr/bin/env python3
"""make_qr.py - printable QR (SVG) for a verify page.

Usage:
  python make_qr.py https://wdy.org/certified/verify/WDY-2026-0002/ [out.svg]
Requires: pip install qrcode
Print on posters, end credits, delivery binders - scanners land on the verify page.
"""
import sys, pathlib
import qrcode, qrcode.image.svg

url = sys.argv[1]
out = sys.argv[2] if len(sys.argv) > 2 else "qr.svg"
qr = qrcode.QRCode(error_correction=qrcode.constants.ERROR_CORRECT_M, box_size=12, border=2)
qr.add_data(url); qr.make(fit=True)
img = qr.make_image(image_factory=qrcode.image.svg.SvgPathImage)
data = img.to_string()
if isinstance(data, bytes): data = data.decode("utf-8")
pathlib.Path(out).write_text(data, encoding="utf-8")
print("written:", out, "->", url)
