The upgraded qrcode library for Python
Project description
BetterQR
BetterQR is a powerful, pure-Python QR code generator with zero external QR Generation dependencies.
It generates beautiful, scannable codes with full control over shapes, colours, gradients,
embedded logos, animated GIFs, Micro QR, and more.
Features
| Feature | Details |
|---|---|
| Standard QR | Versions 1–40, ECC L / M / Q / H |
| Micro QR | All versions M1–M4 with correct auto-version selection |
| Module shapes | square, circle, rounded, diamond, star, gapped, vertical_bar, horizontal_bar |
| Colours | 6-char or 3-char hex (#F00), transparent background, separate finder colour |
| Gradients | horizontal, vertical, diagonal, radial |
| Logo embedding | square / rounded / circle shape, optional border, ratio 0.1–0.35 |
| Frames & labels | simple, rounded, double, shadow, fancy; label above or below |
| Animations | 10 GIF effects: shimmer, fade, scan, pulse, build, matrix, wave, blink, typewriter, rotate |
| Data helpers | WiFi, VCard, MeCard, GeoLocation, SMS, Email, Phone, Crypto |
| Output formats | PNG, JPG, SVG, GIF |
| CLI | Full-featured command-line tool |
Installation
pip install betterqr --upgrade
Why BetterQR?
| BetterQR | qrcode |
segno |
|
|---|---|---|---|
| Zero external QR-gen dependencies | ✅ | ✅ | ✅ |
| Module shapes (circle, star, diamond, etc.) | ✅ | ❌ | ❌ |
| Gradients | ✅ | ❌ | ❌ |
| Logo embedding | ✅ | Manual (Pillow) | ❌ |
| Frames & labels | ✅ | ❌ | ❌ |
| Animated GIF output | ✅ | ❌ | ❌ |
| Micro QR (M1–M4) | ✅ | ❌ | ✅ |
| WiFi / vCard / MeCard / SMS / Email / Phone helpers | ✅ | ❌ | Partial |
| CLI included | ✅ | ✅ | ✅ |
| SVG / PDF / EPS output | ✅ | SVG only | ✅ |
Quick Start
CLI
# Basic QR code
betterqr "https://example.com" my_qr.png
# Micro QR (auto-selects smallest version)
betterqr "HELLO" --type micro micro.png
# Styled with gradient
betterqr "Hello" my_qr.png --gradient "#FF6B6B" "#4ECDC4" --gradient-dir radial
# With logo (use ECC H for logos)
betterqr "https://mysite.com" qr.png --logo logo.png --logo-ratio 0.3 --logo-shape rounded -e H
# Animated GIF
betterqr "Animated QR" animated.gif --effect matrix --fps 12
# WiFi
betterqr --wifi MySSID MyPassword output.png
# Contact
betterqr --contact "Jane Doe" --phone "+1-555-1234" --email "jane@example.com" contact.png
Python API
from betterqr import QR, WiFi, VCard, GeoLocation, SMS, Email, Phone
# Basic
QR("https://example.com").save("qr.png")
# Micro QR — all versions
QR("1234", qr_type="micro", version=1, ecc="M").save("m1.png") # numeric only
QR("HELLO WORLD", qr_type="micro", version=3, ecc="M").save("m3.png") # alphanumeric
QR("Hello!", qr_type="micro", version=4, ecc="L").save("m4.png") # byte mode
# Styling
(QR("styled")
.style(shape="circle", fill="#6C3082", back="#F3E8FF")
.save("styled.png"))
# 3-char hex works too
QR("x").style(fill="#000", back="#FFF").save("mono.png")
# Gradient
QR("gradient").gradient("#FF6B6B", "#4ECDC4", direction="radial").save("grad.png")
# Logo (border=True adds a thin outline around the logo)
(QR("https://mysite.com", ecc="H")
.logo("logo.png", ratio=0.25, shape="rounded", border=True)
.save("logo.png"))
# Frame + label
(QR("https://example.com")
.frame("fancy")
.label("Scan Me!", position="below")
.save("framed.png"))
# Animation
QR("Hello", ecc="H", version=4).animate("matrix", frames=30, fps=15).save("anim.gif")
# Data helpers — pass the helper directly or convert to string
QR(WiFi("MyNet", "MyPass", "WPA")).save("wifi.png")
QR(GeoLocation(51.5074, -0.1278)).save("geo.png")
QR(SMS("+15550199", "Hello!")).save("sms.png")
QR(Email("hi@example.com")).save("email.png")
QR(Phone("+18005550199")).save("phone.png")
QR(VCard("Jane Doe", phone="+15550199", email="jane@example.com")).save("vcard.png")
Micro QR Capacities
| Symbol | Size | Max Numeric | Max Alpha | Max Bytes |
|---|---|---|---|---|
| M1/M | 11×11 | 5 | — | — |
| M2/L | 13×13 | 10 | 6 | — |
| M2/M | 13×13 | 8 | 5 | — |
| M3/L | 15×15 | 23 | 14 | 9 |
| M3/M | 15×15 | 18 | 11 | 7 |
| M4/L | 17×17 | 35 | 21 | 15 |
| M4/M | 17×17 | 30 | 18 | 13 |
| M4/Q | 17×17 | 21 | 13 | 9 |
[!NOTE] Micro QR does not support ECC H. Use standard QR for logos. Micro QR cannot be scanned using normal phone cameras
[!TIP] Use a dedicated Micro QR Scanner to test the Micro QR codes
Documentation
Check out the DOCUMENTATION for an better overview of BetterQR
License
Regsitred under MIT LISCENSE — see LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file betterqr-2.0.0.tar.gz.
File metadata
- Download URL: betterqr-2.0.0.tar.gz
- Upload date:
- Size: 57.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36ac609399b75b4733be2e4a816cfd330139529b678b3aac264d5c4f240c25a4
|
|
| MD5 |
dd896a6febcf9be1a165a06a2f839a32
|
|
| BLAKE2b-256 |
82638443cf4579e9f97272ca92a3ec787428022342ba0ba413b962a9fad4025c
|
Provenance
The following attestation bundles were made for betterqr-2.0.0.tar.gz:
Publisher:
pypi-publish.yml on DevX-Dragon/betterqr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
betterqr-2.0.0.tar.gz -
Subject digest:
36ac609399b75b4733be2e4a816cfd330139529b678b3aac264d5c4f240c25a4 - Sigstore transparency entry: 2186088940
- Sigstore integration time:
-
Permalink:
DevX-Dragon/betterqr@7e550fef299aaf1d2f82266e87fc0071b453d847 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/DevX-Dragon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@7e550fef299aaf1d2f82266e87fc0071b453d847 -
Trigger Event:
release
-
Statement type:
File details
Details for the file betterqr-2.0.0-py3-none-any.whl.
File metadata
- Download URL: betterqr-2.0.0-py3-none-any.whl
- Upload date:
- Size: 52.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6d55b671d3e524bb3593f7950a52e5499585fde0fc6821830df08f7b999a9e5
|
|
| MD5 |
d94ff097d017b46f470e51fc3e2e18cf
|
|
| BLAKE2b-256 |
388ea27bb3b444f2378f49970bdc7d76daed8610a41c612c850b65f28741a9fc
|
Provenance
The following attestation bundles were made for betterqr-2.0.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on DevX-Dragon/betterqr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
betterqr-2.0.0-py3-none-any.whl -
Subject digest:
c6d55b671d3e524bb3593f7950a52e5499585fde0fc6821830df08f7b999a9e5 - Sigstore transparency entry: 2186088977
- Sigstore integration time:
-
Permalink:
DevX-Dragon/betterqr@7e550fef299aaf1d2f82266e87fc0071b453d847 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/DevX-Dragon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@7e550fef299aaf1d2f82266e87fc0071b453d847 -
Trigger Event:
release
-
Statement type: