zxing-cpp
Python bindings for the zxing-cpp barcode library
What it is and what it does
zxing-cpp is a Python wrapper around the zxing-cpp C++ barcode library, enabling detection and generation of barcodes and QR codes from images. It exposes two main operations: read_barcodes() to detect and decode barcodes in an image (returning text, format, content type, and position), and create_barcode() to generate barcode images in multiple output formats (PNG via array or SVG). The package has no runtime Python dependencies and ships prebuilt wheels for current Python versions on major platforms, making installation straightforward on supported systems.
The bindings are built with nanobind and scikit-build-core, which handle C++20 compilation. Reading requires an image input; writing produces either an image array or SVG string. The library supports configurable parameters like error correction level for QR codes and quiet zone control for SVG output.
Use it for:
- Detect and decode barcodes from images in inventory or point-of-sale applications
- Generate QR codes for URLs or product identifiers on demand or in batch
- Automate barcode recognition in document processing or logistics workflows
- Create printable barcode labels with configurable scale and format
- Integrate barcode recognition into image analysis pipelines
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads and writes barcodes and QR codes in images using Python bindings to the zxing-cpp C++ library.
Yes. The package is actively maintained, marked Production/Stable, has no known vulnerabilities, and offers broad platform coverage via prebuilt wheels. Medium install friction is typical for compiled bindings and not a blocker. Use it if you need barcode reading and writing in Python.
Install
zxing-cpp on PyPI
pip
pip install zxing-cppuv
uv add zxing-cpppoetry
poetry add zxing-cppInstalling zxing-cpp
Before you install
Medium install friction due to compiled C++ bindings; prebuilt wheels available for Python 3.9+ on macOS (Intel and ARM), Linux (x86_64 and aarch64), and Windows (x86_64 and ARM64). Building from source requires a C++20 compiler.
License in practice
Apache-2.0 permissive license allows use in commercial and proprietary projects with minimal restrictions; attribution required.
Quickstart
pip install zxing-cpp
import zxingcpp
# Reading barcodes from an image
barcodes = zxingcpp.read_barcodes(img)
for barcode in barcodes:
print(barcode.text, barcode.format)
# Writing a QR code
qr = zxingcpp.create_barcode('test', zxingcpp.BarcodeFormat.QRCode)
img_array = qr.to_image(scale=5)
Requires Python 3.9 or later; image input and output handling depend on external libraries like OpenCV or PIL, which are not runtime dependencies of zxing-cpp.
Verify before relying
- Which barcode formats are supported by the read_barcodes and create_barcode functions
- Performance characteristics (speed, memory usage) for large images or batch processing
- Whether to_image() returns a numpy array or requires PIL/Pillow for conversion
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 16 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 860,737/month — #4,873 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: zxing_cpp-3.1.1-cp310-cp310-macosx_10_15_x86_64.whl; zxing_cpp-3.1.1-cp310-cp310-macosx_11_0_arm64.whl; zxing_cpp-3.1.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; zxing_cpp-3.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; zxing_cpp-3.1.1-cp310-cp310-win_amd64.whl; zxing_cpp-3.1.1-cp310-cp310-win_arm64.whl; zxing_cpp-3.1.1-cp311-cp311-macosx_10_15_x86_64.whl; zxing_cpp-3.1.1-cp311-cp311-macosx_11_0_arm64.whl; zxing_cpp-3.1.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; zxing_cpp-3.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; zxing_cpp-3.1.1-cp311-cp311-win_amd64.whl; zxing_cpp-3.1.1-cp311-cp311-win_arm64.whl; zxing_cpp-3.1.1-cp312-abi3-macosx_10_13_x86_64.whl; zxing_cpp-3.1.1-cp312-abi3-macosx_11_0_arm64.whl; zxing_cpp-3.1.1-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; zxing_cpp-3.1.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; zxing_cpp-3.1.1-cp312-abi3-win_amd64.whl; zxing_cpp-3.1.1-cp312-abi3-win_arm64.whl; zxing_cpp-3.1.1-cp313-cp313t-macosx_10_15_x86_64.whl; zxing_cpp-3.1.1-cp313-cp313t-macosx_11_0_arm64.whl
Keywords: barcode
Tags
More Graphics packages
Pillow adds image processing capabilities to…
permissive · top 100 on PyPI
fonttoolsfonttools manipulates font files in multiple…
permissive · top 1,000 on PyPI
matplotlib-inlineEnables matplotlib figures to display inline…
permissive · top 1,000 on PyPI
pymupdfPyMuPDF extracts, renders, converts, and…
agpl · top 1,000 on PyPI
pypdfium2pypdfium2 is a Python binding to PDFium that…
permissive · top 1,000 on PyPI
altairAltair is a declarative Python library for…
permissive · top 1,000 on PyPI
pyzxingDecode barcodes and QR codes from images or…
permissive · top 15,000 on PyPI
qrcodeGenerates QR codes as images (PNG, SVG) or…
permissive · top 1,000 on PyPI
pyzbarDecodes one-dimensional barcodes and QR codes…
permissive · top 5,000 on PyPI
pylibdmtxReads and writes Data Matrix barcodes,…
permissive · top 15,000 on PyPI
python-escposPython library to send text, images, barcodes,…
permissive · top 15,000 on PyPI
biipBiip parses and interprets data encoded in…
permissive · top 15,000 on PyPI
treepoemGenerates barcodes and QR codes as image…
permissive · top 5,000 on PyPI
nanobindnanobind exposes C++ types in Python and vice…
permissive · top 5,000 on PyPI
pyStrichpyStrich generates 1D and 2D barcodes (Code 39,…
permissive · top 15,000 on PyPI
qreaderQReader detects and decodes QR codes from…
permissive · top 15,000 on PyPI