skillfed

zxing-cpp

Python bindings for the zxing-cpp barcode library

zxing-cpp v3.1.1 860.7K downloads/30d#4,873 on PyPI1,965
Permissive license Apache-2.0 Active released

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-cpp

uv

uv add zxing-cpp

poetry

poetry add zxing-cpp

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Multimedia :: Graphics

Tags

barcode reading pythonqr code generationbarcode detection imagebarcode decode libraryqr code writerbarcode scannerimage barcode recognition
barcode-qrimage-processingc++-bindings

More Graphics packages