zbar-py

Simple python 2 and 3 compatible interface to the zbar barcode-reading library


License
MIT
Install
conda install -c anaconda zbar-py

Documentation

zbar-py

Author: Zachary Pincus zpincus@gmail.com

A Python module (compatible with both Python 2.7 and 3+) that provides an interface to the zbar bar-code reading library, which can read most barcode formats as well as QR codes. Input images must be 2D numpy arrays of type uint8.

Example:

import zbar
image = read_image_into_numpy_array(...) # get an image into a numpy array
scanner = zbar.Scanner()
results = scanner.scan(image)
for result in results:
    print(result.type, result.data, result.quality, result.location)

Zbar is built as a python extension, so no external dependencies are required. Building zbar requires libiconv to be present, which probably isn't a problem except maybe on windows. The python code is under the MIT license, and zbar itself is licensed under the GNU LGPL version 2.1.