qrcode
Pure-Python QR code image generator with pluggable PIL, SVG, and terminal renderers
Repository Health
Technical Analysis
qrcode is a Python library for generating QR code images per the ISO/IEC 18004 spec, with a pure-Python encoder and a set of pluggable image factories — Pillow bitmap output, SVG (including SVG path/fragment/rectangle variants), styled PIL images with rounded modules and embedded logos, and a plain-text/terminal renderer for quick command-line previews. It ships both as an importable module and as a qr console script for generating codes directly from the shell.
What You Get
- A pure-Python QR code encoder implementing ISO/IEC 18004 with configurable error-correction levels
- Multiple pluggable image factories:
PilImage, several SVG variants (SvgImage,SvgFragmentImage,SvgPathImage), andPyPNGImage StyledPilImagesupport for rounded/circular module drawers and embedding a logo image inside the generated code- A plain-text/terminal print mode (
qr.print_ascii()) for quickly previewing a code without saving a file - A
qrcommand-line console script for generating QR codes directly from shell pipelines
Common Use Cases
- Generating QR codes for URLs, contact cards (vCard), or Wi-Fi network credentials embedded in web or mobile app pages
- Producing print-ready vector QR codes (SVG) for packaging, posters, or marketing collateral
- Branding QR codes with a company logo or custom module styling via
StyledPilImagefor marketing materials - Piping quick QR codes from shell scripts or CI pipelines using the bundled
qrconsole command
Under The Hood
Architecture — base.py/util.py implement the QR encoding algorithm (data segment encoding, Reed-Solomon error correction, mask pattern scoring) producing an abstract module matrix; main.py’s QRCode class drives generation and delegates rendering to an injectable image_factory, with concrete factories in image/ (pil.py, svg.py, styledpil.py, pure.py) implementing a common interface so new output formats can be added without touching the encoder. Tech Stack — Pure Python core with zero hard runtime dependencies; Pillow is an optional dependency pulled in only when the PIL image factory is used, and the build uses Poetry (poetry-core) as its build backend. Code Quality — An 18-file tests/ package exercises the encoder, each image factory, and the console script; the project has a PACKAGING.rst/TESTING.rst and a signed release process (signing-key.asc), signals of a maintained release discipline even though day-to-day commit activity is currently low. API Design — The default path (qrcode.make(data)) requires a single function call for a basic PNG, while advanced use (custom error correction, styled modules, SVG variants) is opt-in through constructor keyword arguments and the swappable image_factory parameter — a clean minimal-to-advanced API progression.
Used by 5 apps in this directory
Baserow
No Code Platforms · Databases
Open-source no-code platform to build databases, apps, automations, and AI agents — self-hosted or cloud, with full data ownership.
Horilla
Human Resources · ERP
Open-source HRMS covering recruitment, attendance, payroll, and biometrics in one self-hosted Django application.
Odoo
ERP · CRM · Productivity
The open source ERP platform that integrates CRM, accounting, inventory, manufacturing, and 60+ business apps into one seamlessly connected suite.
Stirling PDF
Productivity · Digital Signiture
The open-source PDF platform you can run anywhere — edit, convert, sign, and automate PDFs without sending files to external servers.
Weblate
Developer Tools
Continuous localization platform that commits translations directly into your version control system with full translator attribution.