Skip to main content

QR Code & Barcode Scanner for Python: the Python logo, the quick start in Python, and a QR code and a barcode being read

QR Code & Barcode Scanner for Python

Ask AI

ChatGPT Claude Gemini Grok Perplexity Copilot DeepSeek Meta AI Qwen

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.

How it works

How the Python package works, in three steps: install the package, pass an image or a camera frame to the engine inside your process, and read the report

The picture shows the three steps of the package. The next sections follow them: install the package, pass the bytes of an image or the pixels of a camera frame to the engine inside your process, then read the report it returns.

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.2

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.2/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.

Both also accept formats, a list of the symbologies to look for by the names a report uses, such as ["qr_code", "ean13"]. No reader of another symbology runs, and report["trace"]["formats"] says what was looked for. Unset or empty reads every symbology; an unknown name raises ValueError ending [QRS-006].

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

A QR code and Code 128 decoded from the same image, each outlined where the engine measured it

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.

The code families the engine reads: QR codes, matrix and stacked codes such as Data Matrix, retail barcodes such as EAN-13, and other linear barcodes such as Code 128

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

One engine in the language you write: Rust on crates.io, Node.js and the browser on npm, Python on PyPI, Go, PHP, and the qrscan command line

Runtime Package How it scans
Rust qrcode-barcode-scanner on crates.io In process
Node.js @qrcode-ai-com/qrcode-barcode-scanner on npm In process, native
Browser @qrcode-ai-com/qrcode-barcode-scanner-wasm on npm In the page, WebAssembly
Python qrcode-barcode-scanner on PyPI In process
Go qrcode-barcode-scanner-go Through the installed qrscan
PHP qrcode-barcode-scanner-php Through the installed qrscan
Command line 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.2

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

Source distribution (sdist)

Source distribution for qrcode-barcode-scanner 0.12.2
File Size Uploaded Provenance Actions
qrcode_barcode_scanner-0.12.2.tar.gz 566.0 kB With provenance Details for qrcode_barcode_scanner-0.12.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for qrcode-barcode-scanner 0.12.2
File Actions
qrcode_barcode_scanner-0.12.2-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for qrcode_barcode_scanner-0.12.2-cp38-abi3-win_amd64.whl
qrcode_barcode_scanner-0.12.2-cp38-abi3-musllinux_1_2_x86_64.whl CPython 3.8 abi3 Linux musl 1.2+ x86-64 Details for qrcode_barcode_scanner-0.12.2-cp38-abi3-musllinux_1_2_x86_64.whl
qrcode_barcode_scanner-0.12.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details for qrcode_barcode_scanner-0.12.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
qrcode_barcode_scanner-0.12.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details for qrcode_barcode_scanner-0.12.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
qrcode_barcode_scanner-0.12.2-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for qrcode_barcode_scanner-0.12.2-cp38-abi3-macosx_11_0_arm64.whl
qrcode_barcode_scanner-0.12.2-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details for qrcode_barcode_scanner-0.12.2-cp38-abi3-macosx_10_12_x86_64.whl

Total release size: 12.9 MB

Release files / qrcode_barcode_scanner-0.12.2.tar.gz

Download URL qrcode_barcode_scanner-0.12.2.tar.gz
Size 566.0 kB
Tags Source
SHA-256 checksum
How to use checksums
42b76cd0eb00412de341b20e05b902fa0b7a2f4bddb66d1179e9705edbaea8f4
BLAKE2b-256 checksum
How to use checksums
b1abf89fd544c55195727d145cd673415781029be3808cdf5d1711eded3efc30
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 27, 2026.

Transparency log

Release files / qrcode_barcode_scanner-0.12.2-cp38-abi3-win_amd64.whl

Download URL qrcode_barcode_scanner-0.12.2-cp38-abi3-win_amd64.whl
Size 1.9 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
1ee22378789e9ca28e545d505af2d30358b47e81dfc46aebaf2a4a6be8b54133
BLAKE2b-256 checksum
How to use checksums
68150a7e920650296354f206b5e817f80eae4b076b90974921a9d6d17ef03ea9
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 27, 2026.

Transparency log

Release files / qrcode_barcode_scanner-0.12.2-cp38-abi3-musllinux_1_2_x86_64.whl

Download URL qrcode_barcode_scanner-0.12.2-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
23224392bd2a6f934f3e5636f56654ed610d51b9b8126d232cf824353f6ac2e2
BLAKE2b-256 checksum
How to use checksums
771d686e72eba1904a7e7cfb62cdbfc6322b3c7f0a79679081ec92210c44ebae
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 27, 2026.

Transparency log

Release files / qrcode_barcode_scanner-0.12.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL qrcode_barcode_scanner-0.12.2-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
df040ba189dd47b9bcb301b85aecc6e1248052f1ab0bd6870f5fd1f7d7944d59
BLAKE2b-256 checksum
How to use checksums
5790b0e9e7abeda23cc3479f35a27def8a60ca53b2941801d6b258508f0b01c5
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 27, 2026.

Transparency log

Release files / qrcode_barcode_scanner-0.12.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL qrcode_barcode_scanner-0.12.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.1 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
f446f382efe3e2f06f433d6ea668159008e0a6302d438da7c9ac963414ad40ab
BLAKE2b-256 checksum
How to use checksums
095373a661f644dede112ebe767d1af764f030ba997d99aec2b91d33b716733b
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 27, 2026.

Transparency log

Release files / qrcode_barcode_scanner-0.12.2-cp38-abi3-macosx_11_0_arm64.whl

Download URL qrcode_barcode_scanner-0.12.2-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
2dde6a3f13b294a3210f291b9c367f3c7d837eb291acc2981793a088e7eaff8d
BLAKE2b-256 checksum
How to use checksums
3d10a97fc35b0d842ccecd03efc620f2d779bdb4ee35c75f45b95fe7938e9b42
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 27, 2026.

Transparency log

Release files / qrcode_barcode_scanner-0.12.2-cp38-abi3-macosx_10_12_x86_64.whl

Download URL qrcode_barcode_scanner-0.12.2-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
6e96d54dfc2c07bf8ea0867cebfea46a7499654533fc91969f404ee551e4813b
BLAKE2b-256 checksum
How to use checksums
fd77cf9fd5f9775cc724367007ed9143d2a76ea42a09efe6de4e6492752471bf
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 27, 2026.

Transparency log

Security for qrcode-barcode-scanner 0.12.2

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.

Select from 7 files

Attestation for qrcode_barcode_scanner-0.12.2.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 27, 2026.

Transparency log

A 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.

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