Skip to main content

ZbarLight

zbarlight is a simple wrapper for the zbar library. For now, it only allows to read QR codes but contributions, suggestions and pull requests are welcome.

zbarlight is compatible with Python 2 and Python 3.

zbarlight is hosted on Github at <https://github.com/Polyconseil/zbarlight/>.

Installation

You need to install ZBar Bar Code Reader <http://zbar.sourceforge.net/> and its headers to use zbarlight:

  • on Debian, apt-get install libzbar0 libzbar-dev

  • on Mac OS X, brew install zbar

Then you should use pip or setuptools to install the zbarlight wrapper.

How To use ZbarLight

The new way:

from PIL import Image
import zbarlight

file_path = './tests/fixtures/two_qr_codes.png'
with open(file_path, 'rb') as image_file:
    image = Image.open(image_file)
    image.load()

codes = zbarlight.scan_codes('qrcode', image)
print('QR codes: %s' % codes)

The deprecated way:

from PIL import Image
import zbarlight

file_path = './tests/fixtures/one_qr_code.png'
with open(file_path, 'rb') as image_file:
    image = Image.open(image_file)
    image.load()
converted_image = image.convert('L')  # Convert image to gray scale (8 bits per pixel).
image.close()

raw = converted_image.tobytes()  # Get image data.
width, height = converted_image.size  # Get image size.
code = zbarlight.qr_code_scanner(raw, width, height)

print('QR code: %s' % code.decode())

Metadata

Release files for fastzbarlight 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastzbarlight 0.0.4
File Size Uploaded Provenance Actions
fastzbarlight-0.0.4.tar.gz 817.9 kB Without provenance Details for fastzbarlight-0.0.4.tar.gz

Release files / fastzbarlight-0.0.4.tar.gz

Download URL fastzbarlight-0.0.4.tar.gz
Size 817.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2e3745fe984d178f3176a39d69111c104cf517e5b1dbf524d120ff98c7b9ad10
BLAKE2b-256 checksum
How to use checksums
862fca4f3e4248dcbf23c5bb132dca35538abdc618d343d0a55ad0ea614ef738
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for fastzbarlight 0.0.4

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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