qrcode

Pure-Python QR code image generator with pluggable PIL, SVG, and terminal renderers

Library
PyPI
v8.2
4,944 stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
48 /100 Fair
Development Activity 4
Maintenance 0
Community 88
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
77 /100 Good
Architecture 78
Code Quality 75
Innovation 68
Learning Curve 85

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), and PyPNGImage
  • StyledPilImage support 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 qr command-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 StyledPilImage for marketing materials
  • Piping quick QR codes from shell scripts or CI pipelines using the bundled qr console 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

Python
68%
Other

Baserow

Databases · No Code Platforms

6,012

Open-source no-code platform to build databases, apps, automations, and AI agents — self-hosted or cloud, with full data ownership.

View details
89
Repo Health
84
Technical
68
Dependency
Built with
Python 68%
JavaScript 16%
Vue 11%
Updated 1 weeks ago
HTML
46%
LGPL-2.1

Horilla

ERP · Human Resources

1,437

Open-source HRMS covering recruitment, attendance, payroll, and biometrics in one self-hosted Django application.

View details
91
Repo Health
60
Technical
65
Dependency
Built with
HTML 46%
Python 38%
JavaScript 12%
Updated 1 weeks ago
Python
52%
Other

Odoo

CRM · ERP · Productivity

54,709

The open source ERP platform that integrates CRM, accounting, inventory, manufacturing, and 60+ business apps into one seamlessly connected suite.

View details
87
Repo Health
82
Technical
64
Dependency
Built with
Python 52%
JavaScript 44%
Updated 1 weeks ago
Java
46%
Other

Stirling PDF

Digital Signiture · Productivity

93,148

The open-source PDF platform you can run anywhere — edit, convert, sign, and automate PDFs without sending files to external servers.

View details
92
Repo Health
86
Technical
71
Dependency
Built with
Java 46%
TypeScript 45%
Updated 1 weeks ago
Python
91%
GPL 3.0

Weblate

Developer Tools

6,094

Continuous localization platform that commits translations directly into your version control system with full translator attribution.

View details
95
Repo Health
86
Technical
67
Dependency
Built with
Python 91%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers