Registry / serialization / segno
library1.6.6pypypi✓ verified 22d ago

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 segno
INSTALL
IMPORT
SIG · SEGNO
S
segno
serializationpythonv1.6.6
Install
1.6s avg
Import
128ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.6.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.128s · 18.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.128s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

make
import segno qrcode = segno.make('Your data')
The `make` function is the primary entry point for creating QR codes and Micro QR codes.
helpers
from segno import helpers
The `helpers` module provides high-level functions for specific data types like vCard or Wi-Fi configurations.

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.

import segno # Create a QR code for a URL qrcode = segno.make('https://example.com/your-data') # Save the QR code as a PNG file with a scale of 5 qrcode.save('my_qrcode.png', scale=5) # Or save as SVG # qrcode.save('my_qrcode.svg', scale=5) # Create a colorful QR code colorful_qrcode = segno.make('https://example.com/colorful', dark='darkblue', light='lightblue') colorful_qrcode.save('my_colorful_qrcode.png', scale=5) print('QR codes generated successfully: my_qrcode.png and my_colorful_qrcode.png')
segno --version
Debug
Known issues
breakingSegno dropped support for Python 2.7 starting from version 1.6.0. Python 2.7 reached its End-of-Life on January 1, 2020.
fix
Migrate your project to Python 3.5+ (ideally 3.10+ to avoid additional dependencies) if using Segno 1.6.0 or newer.
affects: >=1.6.0
breakingStarting with Segno 1.6.0, the internal dependency on `pkg_resources` was removed and replaced by `importlib.metadata`. For Python versions older than 3.10, this introduces a new explicit dependency on the `importlib-metadata` backport package.
fix
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).
affects: >=1.6.0
gotchaSegno releases 1.6.4 and 1.6.5 (fixed in 1.6.6) had packaging issues where man pages were placed in the wrong directory or source distributions did not include all relevant files. While fixed, this highlights a potential for minor distribution-related glitches in point releases.
fix
Always use the latest stable patch release (e.g., 1.6.6) to avoid such packaging issues.
affects: 1.6.4, 1.6.5
gotchaIn versions prior to 1.3.3, the `segno.helpers.make_wifi` and `segno.helpers.make_wifi_data` functions could generate invalid data if input strings contained characters that could be misinterpreted as integers.
fix
Upgrade to Segno 1.3.3 or newer to ensure correct generation of Wi-Fi QR codes, as this issue was resolved.
affects: <1.3.3
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'segno'
The 'segno' package is not installed in the current Python environment.
fix
pip install segno
AttributeError: 'segno.QRCode' object has no attribute 'save_png'
The 'segno' library uses a single 'save()' method to write the QR code, inferring the format from the filename extension or requiring an explicit 'kind' argument, rather than format-specific methods like 'save_png'.
fix
qr.save('my_qrcode.png')
TypeError: make() missing 1 required positional argument: 'content'
The 'segno.make()' function requires at least the 'content' argument (the data to encode) to be provided.
fix
qr = segno.make('your data here')
segno.QRCodeError: Not enough modules to store the content
The content to be encoded is too large to fit into the current QR code version or error correction level.
fix
qr = segno.make('your very long data string', error='h') # Increase error correction level, providing more capacity
Upgrade
Version history
1.6.6latest on PyPI · released Mar 12, 2025
Audit
Dependencies
importlib-metadataoptionalRequired for Python versions < 3.10 after Segno 1.6.0, as it replaced pkg_resources for plugin discovery.
Agent activity
9 hits · last 30 days
node
8
Resources
segno — pip install segno · libregistry