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

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

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.1
File Size Uploaded Provenance Actions
qrcode_barcode_scanner-0.12.1.tar.gz 553.2 kB With provenance Details for qrcode_barcode_scanner-0.12.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for qrcode-barcode-scanner 0.12.1
File Actions
qrcode_barcode_scanner-0.12.1-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for qrcode_barcode_scanner-0.12.1-cp38-abi3-win_amd64.whl
qrcode_barcode_scanner-0.12.1-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.1-cp38-abi3-musllinux_1_2_x86_64.whl
qrcode_barcode_scanner-0.12.1-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.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
qrcode_barcode_scanner-0.12.1-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.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
qrcode_barcode_scanner-0.12.1-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for qrcode_barcode_scanner-0.12.1-cp38-abi3-macosx_11_0_arm64.whl
qrcode_barcode_scanner-0.12.1-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details for qrcode_barcode_scanner-0.12.1-cp38-abi3-macosx_10_12_x86_64.whl

Total release size: 12.9 MB

Release files / qrcode_barcode_scanner-0.12.1.tar.gz

Download URL qrcode_barcode_scanner-0.12.1.tar.gz
Size 553.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fe608449aa089d46d904c7589e3d3d76944fdb7701ccd5a3659f7e582e596337
BLAKE2b-256 checksum
How to use checksums
7f762834af013290606552747adb4578c20860938839085e19adf78e86ca4728
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 26, 2026.

Transparency log

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

Download URL qrcode_barcode_scanner-0.12.1-cp38-abi3-win_amd64.whl
Size 1.9 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f867389db50e963c1624d6a4ad72bb5ac4d51b452d4b37f6e4efe816d428c028
BLAKE2b-256 checksum
How to use checksums
95a9448c648fa4c0fe5ce504965a78746aa551ffb6b047a35fa776bdf00e7a45
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 26, 2026.

Transparency log

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

Download URL qrcode_barcode_scanner-0.12.1-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
490de4616638630e32f9360e28f19a32ccf7ca5503960849dbaac009b4759892
BLAKE2b-256 checksum
How to use checksums
616488368253a90cae8f401e92691366bf7f0e5a689ae13b5b1db551c54b6b9c
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 26, 2026.

Transparency log

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

Download URL qrcode_barcode_scanner-0.12.1-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
058ec0245ef3a29993acaaa3cb9c195b4ba9f94aca58b9b19b70f2a707688c70
BLAKE2b-256 checksum
How to use checksums
5c2d160cfb30c724b2a872f34d6ea37fa3d0229ec4570593aa7cb5700ae02b76
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 26, 2026.

Transparency log

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

Download URL qrcode_barcode_scanner-0.12.1-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
0ebe67ea597155214c1a2d7a3fa69d48767929829312181a5cc83be16a9c1648
BLAKE2b-256 checksum
How to use checksums
5a37a1a1e07de67ee004e9eb114bcc0f972bfa2879dab4a53e8db0b50655dc7a
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 26, 2026.

Transparency log

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

Download URL qrcode_barcode_scanner-0.12.1-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
1a91607c1c5bd7476c2ad9e96a8723c0a4b23dcf36840cf636b725a42ad18c3c
BLAKE2b-256 checksum
How to use checksums
63d744f2e91c0b9c34f0061d8d1a937978de09cd1c00ad54251471c55ef716e1
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 26, 2026.

Transparency log

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

Download URL qrcode_barcode_scanner-0.12.1-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
2492a6afd0ca888a9c03ea5dcbe51c27160e597d97e82b1ab63166c7847b2ccc
BLAKE2b-256 checksum
How to use checksums
dd874237d9c3acd0d79db50c892038e33e052cd31d9abd9b9e330deaa0bcaf96
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 26, 2026.

Transparency log

Security for qrcode-barcode-scanner 0.12.1

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.1.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 26, 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