Skip to main content

Developers Toolbox

QRCode Generator

CLI and library to generate QR codes for text, Wi-Fi, contacts, email, SMS, locations, and calendar events.

The PyPI name is lupaxa-qrcode-generator. The import path is lupaxa.qrcode_generator. The CLI is qrcode-generator (also installed as qrcodes). lupaxa is a namespace package — there is no lupaxa/__init__.py.

Install

pip install lupaxa-qrcode-generator
pip install lupaxa-qrcode-generator[logo]  # optional centre-logo overlay (Pillow)

Requires Python 3.10+. Runtime dependency: segno.

Usage

Each make_* helper returns a segno.QRCode (or a QRCodeSequence when EncodeOptions(sequence=True)). Pass that to save_qr. The file suffix chooses the format (png, svg, pdf, and others that segno supports). scale must be >= 1. border must be >= 0. Parent directories are created when needed. output="-" writes to stdout (set kind for binary formats). Invalid payloads raise ValidationError.

from lupaxa.qrcode_generator import EncodeOptions, data_uri, make_text, make_wifi, save_qr

save_qr(make_text("Hello Simon"), "hello.png")
save_qr(make_wifi("MyWifi", password="Secret!", auth="WPA"), "wifi.png")
save_qr(
    make_text("Hello Simon", options=EncodeOptions(error="H")),
    "hello.svg",
    kind="svg",
    dark="#6D95D3",
    light="transparent",
)
print(data_uri(make_text("Hello Simon"), kind="png"))
qrcode-generator text "Hello Simon" -o hello.png
qrcode-generator wifi --ssid "MyWifi" --password "Secret!" --auth WPA -o wifi.png
qrcode-generator --error H --kind svg text "Hello Simon" -o hello.svg
qrcode-generator --logo logo.png text "Hello Simon" -o branded.png
qrcode-generator --version
qrcode-generator --help

python -m lupaxa.qrcode_generator is the same as the console script. The CLI prints the output path and exits 0. Exit 2 is bad input (invalid URL, WPA without a password, bad event datetime, and so on).

--password is visible in the process list and shell history. Prefer a throwaway guest network when you can.

Payloads

Imported from lupaxa.qrcode_generator. Matching CLI subcommands: text, url, wifi, vcard, tel, email, sms, geo, event.

Name Role
make_text Plain text
make_url Absolute http / https URL
make_wifi WIFI: configuration
make_vcard vCard 3.0
make_tel tel: URI
make_email mailto: URI
make_sms sms: URI (ios= for &body=)
make_geo geo: URI
make_event iCalendar VEVENT
make_qr Encode an arbitrary string
save_qr Write a QR code; optional centre logo
data_uri PNG or SVG data URI
EncodeOptions Error, version, micro, ECI, sequence
ValidationError Invalid payload or save option

Payload string builders live in lupaxa.qrcode_generator.payloads if you want the encoded text without a QR object.

Payload Rules

URL. Must be an absolute http or https URL, not a bare host.

Wi-Fi. --auth WPA (default) and WEP require --password. Use --auth nopass for an open network.

SMS. Default query is RFC-style sms:+44...?body=.... Add --ios for the iOS sms:+44...&body=... form.

Event. --start and --end must be YYYYMMDD, YYYYMMDDTHHMMSS, or YYYYMMDDTHHMMSSZ. Summary, location, and description are escaped for iCalendar (\\, \;, \,, newlines).

Geo. Latitude is -90 to 90. Longitude is -180 to 180.

vCard. Extra fields: --nickname, --birthday (YYYY-MM-DD), --cellphone / --homephone / --workphone / --fax, --photo-uri, and --geo-lat / --geo-lng.

Logo. --logo centres an image on a PNG. Error correction is set to H unless you already passed --error H. Rejected for Micro QR, structured-append sequences, and non-PNG output. Needs the [logo] extra. Keep --logo-size at or under 0.25 and scan the result before you print it.

Examples

qrcode-generator url "https://example.com" -o site.svg
qrcode-generator wifi --ssid "Guest" --auth nopass -o guest.png
qrcode-generator sms --number "+4412345" --message "Meet at 7?" -o sms.png
qrcode-generator geo --lat 51.5014 --lng -0.1419 -o buckingham.png
qrcode-generator event \
    --summary "Project review" \
    --start "20251201T190000Z" \
    --end "20251201T200000Z" \
    --location "Online" \
    -o event.png
qrcode-generator --data-uri png text "Hello Simon"
qrcode-generator --terminal text "Hello Simon"
qrcode-generator -o - --kind svg text "Hello Simon"
from lupaxa.qrcode_generator import make_url, save_qr

save_qr(make_url("https://example.com"), "site.svg")

Development

make init
make python-install-dev
make python-check
The Lupaxa Project Footer

Metadata

Release files for lupaxa-qrcode-generator 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lupaxa-qrcode-generator 0.2.6
File Size Uploaded
lupaxa_qrcode_generator-0.2.6.tar.gz 13.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lupaxa-qrcode-generator 0.2.6
File Interpreter ABI Platform
lupaxa_qrcode_generator-0.2.6-py3-none-any.whl Python 3 none any Details

Total release size: 31.5 kB

Release files / lupaxa_qrcode_generator-0.2.6.tar.gz

Download URL lupaxa_qrcode_generator-0.2.6.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c219d28fd381260cd4153a11c26c7a962dbd6e0fb9508f03dbb38ac799a9f031
BLAKE2b-256 checksum
How to use checksums
ec6e7103f03b15a8fee9ea5b61b5bbd62e8d12ae65066e713ac5e4b1449f4763
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / lupaxa_qrcode_generator-0.2.6-py3-none-any.whl

Download URL lupaxa_qrcode_generator-0.2.6-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca40d447c91b40af8ccd6c17b95f504c7c5bf7f2fce666681804d7922df7ee22
BLAKE2b-256 checksum
How to use checksums
6427d4450c6a097f2c288c21cf69648747c91c8a565110480ee182e2ce945d02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.6 This release

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page