QR Code & Barcode Scanner for Python
Ask AI
Choose an AI assistant to explain this destination using its public sources. Gemini opens gemini.google.com. Gemini, Copilot, DeepSeek, Meta AI and Qwen require pasting the prompt below; the other links include it in their URL. Sign-in or a manual paste may still be required. Check the answer against the documentation.
Copy the plain-text prompt
Use the code block's copy control, or select its complete text, then paste it into your assistant.
Help me understand QR Code & Barcode Scanner for Python (crates/qrcode-ai-scanner-py/README.md) for QR Code & Barcode Scanner, the open-source scanner. Source documentation; publication is not implied. Provided README context (verify against the sources): Use the Python binding for image-processing scripts, notebooks and batch imports that need structured scanner output. Preserve barcode text exactly instead of coercing identifiers into numbers, and handle an empty detection list separately from invalid image bytes. Select the wheel and Python version supported by the release you install; the source README may describe upcoming changes. Read the public documentation below. Explain what this destination does, its documented installation or access steps, a minimal example if supported, prerequisites, limitations and license. Distinguish published packages from working source and preparation. Cite your sources; if a page is unavailable or a fact cannot be checked, say so. Do not invent installation commands, benchmark results or comparisons. Answer in my language. Public sources: https://github.com/qrcode-ai-com/qrcode-barcode-scanner-rust/blob/main/crates/qrcode-ai-scanner-py/README.md https://qrcode-ai.com/en-US/qr-code-scanner https://qrcode-ai.com/en-US/barcode-scanner https://qrcode-ai.com/en-US/qr-code-scanner/sdk/python https://qrcode-ai.com/en-US/barcode-scanner/sdk/python https://qrcode-ai.com/en-US/qr-code-generator https://qrcode-ai.com/en-US/barcode-generator
Use the Python binding for image-processing scripts, notebooks and batch imports that need structured scanner output. Preserve barcode text exactly instead of coercing identifiers into numbers, and handle an empty detection list separately from invalid image bytes. Select the wheel and Python version supported by the release you install; the source README may describe upcoming changes.
The QR code scanner and barcode scanner are QR Code AI’s browser scanning entry points. For the corresponding development route, the QR code scanner Python guide and barcode scanner Python guide connect this documentation to the two product journeys. If a product page is unavailable, the instructions and references in this README remain the starting point for this source directory.
To prepare a sample label for a Python notebook, use the QR code generator or the barcode generator. Keep the original payload with the exported image so that you can compare the scan result with the value you intended to encode.
Decode QR codes, linear barcodes and other 2D formats, including Data Matrix, with a local Rust engine. Read decoded content and measured symbol geometry from Python, with QR scannability diagnostics for artistic or photo-captured codes.
The distribution is qrcode-barcode-scanner; the import is
qrcode_barcode_scanner. Python 3.8 or later is required. The PyO3 extension
returns the same versioned ScanReport as the Rust, Node.js and browser bindings.
Python API · Report contract · Scoring
The scanner used by QR Code AI can also check batches of saved QR designs and barcode photos from a Python workflow.
Install
Create a virtual environment with CPython 3.8 or later. If your system names
the interpreter python3, use that command to create the environment:
python -m venv .venv
Activate it with source .venv/bin/activate on macOS/Linux, or
.\.venv\Scripts\Activate.ps1 in Windows PowerShell. Then install the exact
release as a prebuilt wheel:
python -m pip install --only-binary=:all: qrcode-barcode-scanner==0.12.0
The binary-only option prevents an unexpected Rust source build. If pip cannot find a compatible wheel, stop and check your interpreter and platform against the release's PyPI files. The release wheels cover macOS ARM64/x64, GNU/Linux ARM64/x64, musl Linux x64 and Windows x64; wheel tags describe compatibility, not a test of every host. Reading working source does not establish that its version is on PyPI.
Scan an image
Download a sample image containing QR https://qrc-ai.com/76xMa and Code 128
STOCK-4827:
curl -fsSL -o label.png \
https://raw.githubusercontent.com/qrcode-ai-com/qrcode-barcode-scanner-rust/v0.12.0/fixtures/symbology/mixed-code128-qr.png
In Windows PowerShell, use curl.exe in place of curl for the download.
Save the following as scan.py beside label.png, then run python scan.py
with the virtual environment active. The example prints each decoded value
and keeps an absent quality assessment distinct from a score of zero.
import qrcode_barcode_scanner as qr
with open("label.png", "rb") as image:
report = qr.scan(image.read(), profile="full")
for detection in report["detections"]:
print(detection["symbology"], detection["content"]["text"])
print("Physical occurrences:", len(detection["occurrences"]))
score = report["score"]
if score is not None:
print(score["value"], score["grade"])
elif report["trace"]["budget_exhausted"]:
print("Quality assessment did not finish within the scan budget.")
Repeated physical copies of the same content share one detection with several
occurrences. Different contents stay separate. Use the geometry that was
measured: a linear barcode can have endpoints instead of four corners. QR
metadata and correction-margin diagnostics belong to the QR family only.
A missing score is not zero. QR quality diagnostics are software measurements, not hardware-verifier certification. The extension runs locally; decoding a URL does not visit its destination.
Choose the input
| Function | Input and result |
|---|---|
scan(image, profile="full", ...) |
Encoded PNG, JPEG, WebP or GIF bytes; returns a report dict. |
scan_frame(rgba, width, height, profile="frame", ...) |
Raw RGBA bytes and dimensions; returns the same report shape without an image-format roundtrip. |
capabilities() |
Compiled reader versions, engines and symbologies; not proof that a particular image decodes. |
scan_frame() processes a frame supplied by the caller. It does not acquire a
camera or render an overlay.
Resource limits, budgets and exact payloads
Both scan functions accept max_dimension, max_pixels and budget_ms.
The default caps are 10000 px per side and 64 million pixels; lower them when
processing untrusted uploads. Caps are checked before pixel work.
An unset budget uses the profile default: full 4000 ms, fast 800 ms,
frame 80 ms. budget_ms=0 removes the scan budget for reproducible scans.
The clock starts after image decoding; the input caps bound the decoding step.
A budget that prevents planned work sets
report["trace"]["budget_exhausted"] to True. A None score then means
“not judged”, and an empty detections list does not establish a completed search.
When no code is detected, the report contains an empty detections list.
Invalid input or invalid scan options can raise ValueError; engine faults carry their QRS-xxx code.
content["raw"] is base64: original payload bytes for the QR family, the
reader's reading for other symbologies. content["charset"] describes how
content["text"] reads them. unknown is the only lossy charset; use raw
in that case. Optional eci and fnc1 fields preserve ECI declarations and
FNC1 position. Compare content identity using symbology, raw bytes, FNC1 and
compatible ECI declarations, never display text alone.
What it returns
The picture is a recorded scan of one image that holds a QR code and a Code 128 barcode. Both come back in the same report, each with its format and the place where the engine measured it.
What it reads
The package holds the engine, so it reads what the engine reads. Codes of different formats in the same image come back in one report.
| Family | Formats |
|---|---|
| QR | QR Code, Micro QR, rectangular Micro QR (rMQR) |
| Matrix and stacked | Data Matrix, Aztec, PDF417, MaxiCode |
| Retail | EAN-13, EAN-8, UPC-A, UPC-E |
| Other linear | Code 128, Code 39, Code 93, Codabar, ITF, GS1 DataBar, GS1 DataBar Expanded, Telepen |
The engine's supported formats section states the known limits.
The same engine in other runtimes
| Runtime | Package | How it scans |
|---|---|---|
qrcode-barcode-scanner on crates.io |
In process | |
@qrcode-ai-com/qrcode-barcode-scanner on npm |
In process, native | |
@qrcode-ai-com/qrcode-barcode-scanner-wasm on npm |
In the page, WebAssembly | |
qrcode-barcode-scanner on PyPI |
In process | |
qrcode-barcode-scanner-go |
Through the installed qrscan |
|
qrcode-barcode-scanner-php |
Through the installed qrscan |
|
qrscan |
One command, one JSON report |
The Rust, Node.js, browser and Python packages hold the engine. The Go and PHP packages hold no decoder:
each one starts qrscan and hands you its report.
Language and platform names and logos belong to their owners. They identify a runtime or a destination and imply no endorsement.
Migration and documentation
Releases up to 0.9.0 were published as qrcode-ai-scanner.
To migrate, uninstall the previous distribution, install this one and import
qrcode_barcode_scanner. The rename itself changes no function name or report
field. The
migration guide
covers the runtime-specific steps.
Error codes · Security · Source · Report a bug
Source license: MIT. Published archives retain their own packaged license. Read the current licensing guide and the license packaged with the exact version you install. © SuperNovae Studio.
Maintained by Thibaut Mélen & Nicolas Cella for QR Code AI, a product of SuperNovae Studio. The license of each component is stated in its own license files.
Source license
Project-authored scanner code and documentation in this checkout are available under the MIT License. You may use, modify and redistribute this source in open-source or proprietary applications, including commercial products, while preserving the copyright and permission notice. Thibaut Mélen & Nicolas Cella develop QR Code AI at SuperNovae Studio.
Retained third-party code, dependencies, artwork and test data keep their own licenses and notices. The licensing guide explains these component boundaries; the project license does not assign a license to an unrelated platform or service.
Published archives retain the license shipped with their version. A pinned engine, adapter or bundle may therefore have different terms from this working source. Read its packaged license and the license history before reuse. The source change does not replace an archive or publish a new version.
Metadata
Release files for qrcode-barcode-scanner 0.12.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qrcode_barcode_scanner-0.12.0.tar.gz | 527.2 kB | With provenance | Details for qrcode_barcode_scanner-0.12.0.tar.gz |
Built distributions (wheels)
Total release size: 12.6 MB
Release files / qrcode_barcode_scanner-0.12.0.tar.gz
| Download URL | qrcode_barcode_scanner-0.12.0.tar.gz |
|---|---|
| Size | 527.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a95bde15f2cf5641d7c2c147ace2d05daf04e4216dee33e10efd43bf32c83348
|
|
BLAKE2b-256 checksum How to use checksums |
1a93f3f78e7e275e51b3a9ec627e14d932428286091b898fbc4ebd25f4f0715c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 22, 2026.
Transparency logRelease files / qrcode_barcode_scanner-0.12.0-cp38-abi3-win_amd64.whl
| Download URL | qrcode_barcode_scanner-0.12.0-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
f5f2b0a6eb6092d330bc53a3697140557d16494a352e94966a87f5a927cdca40
|
|
BLAKE2b-256 checksum How to use checksums |
342c87a7c47b7b96c5699b6421911c6d3d24fc40ca7fd9e0e31e05a2ff59d640
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 22, 2026.
Transparency logRelease files / qrcode_barcode_scanner-0.12.0-cp38-abi3-musllinux_1_2_x86_64.whl
| Download URL | qrcode_barcode_scanner-0.12.0-cp38-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3baef0487b1eb837bd9deaf412b00bd40ebc5386c1ea26bcbd2b17a5305e5d8b
|
|
BLAKE2b-256 checksum How to use checksums |
5109731c69aa9c2c9fa6a1fc184a83d78afd9b688074fb8946a7a39623999d60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 22, 2026.
Transparency logRelease files / qrcode_barcode_scanner-0.12.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | qrcode_barcode_scanner-0.12.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
70f2827a62fcd7a5128363dc2387ec09d958b92c82238420e7e2c900fc6b1bcc
|
|
BLAKE2b-256 checksum How to use checksums |
396db8b08b8217824b0cc5099883de5e9042da7f93dd2b3bf7672c9fd0e15c8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 22, 2026.
Transparency logRelease files / qrcode_barcode_scanner-0.12.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | qrcode_barcode_scanner-0.12.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
b023cb005694abe64b0707cfc74c0988d00d7dff088f71c8dabc3a4b12af5886
|
|
BLAKE2b-256 checksum How to use checksums |
15b462214ca0ef14d82fd21403512408a4d644cadfeef27647743c86e58d9d65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 22, 2026.
Transparency logRelease files / qrcode_barcode_scanner-0.12.0-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | qrcode_barcode_scanner-0.12.0-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fb39ba637882eb42b142018e9df9405d94c7a2a26bbb1e0377643b625e07b085
|
|
BLAKE2b-256 checksum How to use checksums |
ccf1df22317cadbdab6fb902a42f5aebb9ec7f7837a2f49f7dee117d379b6ff6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 22, 2026.
Transparency logRelease files / qrcode_barcode_scanner-0.12.0-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | qrcode_barcode_scanner-0.12.0-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
b64319c2272e230732a98f6ea2668b207853537e38cc76bc543a0db0c02d7a13
|
|
BLAKE2b-256 checksum How to use checksums |
ae54a125f8c53845daa17bbe5b146e0b59c234a0127c82a6b10ce3dfc8c1a97c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 22, 2026.
Transparency logSecurity for qrcode-barcode-scanner 0.12.0
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.
Full provenance
All 7 files in this release have been uploaded with provenance metadata.
Attestation for qrcode_barcode_scanner-0.12.0.tar.gz
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 Nov 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.