zxing-cpp (2.2.0)

Published 2024-11-27 18:40:57 +01:00 by eofredj

Installation

pip install --index-url  zxing-cpp

About this package

Python bindings for the zxing-cpp barcode library

Python bindings for zxing-cpp

Build + Deploy PyPI

Installation

pip install zxing-cpp

or

python setup.py install

[Note: To install via setup.py (or via pip install in case there is no pre-build wheel available for your platfor or python version), you need a suitable build environment including a c++ compiler.]

Usage

import cv2, zxingcpp

img = cv2.imread('test.png')
results = zxingcpp.read_barcodes(img)
for result in results:
	print('Found barcode:'
		f'\n Text:    "{result.text}"'
		f'\n Format:   {result.format}'
		f'\n Content:  {result.content_type}'
		f'\n Position: {result.position}')
if len(results) == 0:
	print("Could not find any barcode.")

To get a full list of available parameters for read_barcodes and write_barcode as well as the properties of the result objects, have a look at the PYBIND11_MODULE definition in this c++ source file.

Requirements

Requires Python: >=3.6
Details
PyPI
2024-11-27 18:40:57 +01:00
9
ZXing-C++ Community
Apache License 2.0
973 KiB
Assets (1)
Versions (2) View all
2.3.0 2025-01-14
2.2.0 2024-11-27