Segno
Dependency-free, pure Python QR Code and Micro QR Code generator with many output formats.
Repository Health
Technical Analysis
Segno is a pure Python QR Code and Micro QR Code generator with no external dependencies. It implements the ISO/IEC 18004:2015(E) specification, producing standards-conformant QR and Micro QR symbols with a simple segno.make() call.
It serializes codes to a wide range of formats — SVG, PNG, EPS, PDF, Netpbm, LaTeX/TikZ, XBM, and more — without pulling in any third-party libraries, and ships high-level factories for encoding WiFi configs, vCard/MeCard contact data, and EPC payment QR codes. Segno also supports Structured Append (splitting a message across several codes) and includes a command-line interface.
What You Get
segno.make()for QR and Micro QR Code generation conforming to ISO/IEC 18004:2015- Serializers for SVG, PNG, EPS, PDF, Netpbm, LaTeX/TikZ, XBM, XPM and more with no external libs
- High-level helpers for WiFi, vCard/MeCard, and EPC payment QR codes
- Structured Append support for splitting data across multiple codes
- A command-line interface for generating codes from the shell
Common Use Cases
- Generating QR codes for URLs, tickets, or tracking in a Python backend
- Producing WiFi, vCard, or EPC payment QR codes from structured data
- Rendering scalable SVG or print-ready EPS/PDF QR codes without extra dependencies
- Creating Micro QR Codes where space is constrained
Under The Hood
Architecture The segno package separates concerns cleanly: encoder.py implements the ISO/IEC 18004 matrix encoding (mode analysis, error correction, masking) and returns an immutable QRCode, writers.py holds the many format serializers, helpers.py provides high-level factories (WiFi, vCard, EPC), and cli.py wraps the API for shell use. The public segno.make() in __init__.py orchestrates encoding and hands back an object whose .save()/.png()/.svg() methods dispatch to the writers. Tech Stack Pure Python with no runtime dependencies, packaged via pyproject, type-hinted through bundled .pyi stubs and py.typed, tested with pytest and nox across interpreter versions. Code Quality The project reports 1500+ test cases at >=98% coverage in 61 test modules and is fully typed, indicating strong correctness discipline; recent development activity is low but the code is mature and stable. API Design The API is deliberately tiny and readable — segno.make('data').save('out.png') — with sensible keyword options for scale, color, and error correction, so beginners are productive immediately while advanced serializers remain discoverable.