# UseQR vs the Python qrcode library

> Inside a Python codebase, the qrcode or segno library is usually the right choice — offline, permissively licensed, no third party at runtime. UseQR's API earns its place for no-dependency scripts, spec-validated payloads like UPI and EPC, styled codes that are decode-verified, batches of up to 1,000, and users who do not write Python.

Source: https://useqr.app/vs/useqr-vs-python-qrcode · Last reviewed 2026-08-21 · UseQR is free forever, MIT licensed, no signup.

---

## Start with the honest answer

If you are writing Python and need a QR code, `pip install qrcode` (or `segno`) is
probably the right call, and this page will not pretend otherwise.

```python
import qrcode
qrcode.make("https://example.com").save("out.png")
```

Both libraries are mature, permissively licensed (BSD), offline, and leave no third party
in your runtime path. `segno` deserves particular mention: it is a complete, careful
implementation of ISO/IEC 18004 with no dependencies of its own, supports
[Micro QR](/glossary/micro-qr), and produces tidy SVG. Our
[Python guide](/docs/developers/generate-a-qr-code-in-python) uses these libraries, not
our API, because inside a codebase they are the better tool.

## Where a library-in-code stops being the best tool

**Scripts that should not need an environment.** A cron job, a CI step, a one-liner in a
Makefile. `pip install` means a virtualenv, a lockfile and a Python version to care
about. One `curl` means none of that:

```bash
curl -o out.png "https://useqr.app/api/v1/qr?data=hello&size=512"
```

**Payload correctness.** The library encodes whatever string you assemble. A
[UPI](/upi-qr-code) payload has NPCI field rules; EPC has an IBAN mod-97 checksum; WiFi
strings have escaping rules for `;`, `:` and `\`. UseQR's typed endpoints
(`/api/v1/upi?pa=…`, `/api/v1/epc?iban=…`, `/api/v1/wifi?ssid=…`) validate against the
real specifications and return errors with a `fix` field. Assembling these strings by
hand in Python is precisely where production QR bugs come from.

**Styling that still scans.** Logos, coloured modules, custom eyes — outside the
libraries' scope, and the dangerous part is that a broken result still renders fine.
Every styled code UseQR produces is
[decoded back before delivery](/docs/developers/why-verify-that-your-qr-code-decodes),
and `GET /api/v1/verify?data=…` gives you that check as a service — worth calling from a
pytest suite even when segno does your rendering.

**Batches without loops.** `POST /api/v1/qr/batch` accepts up to **1,000 items** in one
call and is the fastest route from a CSV to a folder of codes; the
[bulk guide](/docs/developers/bulk-qr-generation-at-scale) compares the approaches. For
non-developers there is the [bulk UI](/bulk), which needs no Python at all.

**Decoding.** The generation libraries do not read codes. `POST /api/v1/decode` does,
or use a local library as covered in
[decoding programmatically](/docs/developers/decode-a-qr-code-programmatically).

## The recommendation matrix

| Situation | Use |
|---|---|
| QR rendering inside a Python application | **qrcode or segno** |
| Air-gapped / offline generation | **qrcode or segno** |
| Micro QR, careful SVG, spec depth in-code | **segno** |
| Shell scripts, CI, cron — no environment wanted | UseQR API |
| UPI / EPC / PIX / WiFi payloads, spec-validated | UseQR typed endpoints |
| Styled + logo codes that must provably scan | UseQR (verified output) |
| CSV → 1,000 codes | UseQR batch API or bulk UI |
| Teammates who do not write Python | UseQR |

The combination is legitimate and common: libraries render inside the app, the API's
verify endpoint guards the output in CI, and the bulk UI serves everyone else. Since
UseQR's [core is MIT-licensed](https://github.com/rajkaria/useqr), both columns of the
table are open source.

## FAQ

### What is the best Python library for QR codes?
qrcode is the most widely used and is fine for most needs. segno is the more rigorous implementation — complete ISO/IEC 18004 support including Micro QR, no dependencies, good SVG output. Both are BSD-licensed and free for commercial use.

### Should I use a Python library or a QR API?
Use the library inside applications you ship — it keeps generation offline and dependency-free at runtime. Use an API for no-environment scripts, spec-validated payment or WiFi payloads, verified styled output, and batch jobs.

### How do I verify a Python-generated QR code scans?
Decode it with an independent reader rather than trusting the render. A verify endpoint, or a decoding library in your test suite, catches contrast, logo and styling failures that generation never reports.

### Can Python generate UPI or SEPA payment QR codes?
Yes, but the library only encodes the string you build — the UPI field rules and the EPC IBAN checksum are on you. A spec-validated payload builder catches malformed payment payloads at creation time instead of at the bank.

## Try it

- https://useqr.app/url
- https://useqr.app/validate
- https://useqr.app/bulk
