Segno is a pure Python library for generating QR Codes and Micro QR Codes according to ISO/IEC 18004:2015(E). It provides various serialization formats like Scalable Vector Graphics (SVG), Portable Network Graphics (PNG), Encapsulated PostScript (EPS), Portable Document Format (PDF), and more, without external dependencies for these core functionalities. Currently at version 1.6.6, Segno maintains an active release cadence with several updates per year.
pip install segnoVerified import paths — ran on the pinned version, not inferred.
This quickstart generates two QR codes: a basic one and a colorful one, saving them as PNG images. Segno automatically determines the minimal version and optimal error correction level by default.
Migrate your project to Python 3.5+ (ideally 3.10+ to avoid additional dependencies) if using Segno 1.6.0 or newer.
If running on Python < 3.10 with Segno 1.6.0 or newer, ensure `importlib-metadata` is installed (e.g., `pip install segno 'importlib-metadata<5.0.0'` for Python < 3.8, or simply `pip install segno` for 3.8+ as it's often handled implicitly by modern pip resolving dependencies).
Always use the latest stable patch release (e.g., 1.6.6) to avoid such packaging issues.
Upgrade to Segno 1.3.3 or newer to ensure correct generation of Wi-Fi QR codes, as this issue was resolved.
pip install segno
qr.save('my_qrcode.png')qr = segno.make('your data here')qr = segno.make('your very long data string', error='h') # Increase error correction level, providing more capacity