You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a year of development, the first General Availability of pyzxing is finally released. I would like to express my
gratitude to all the developers for their suggestions and issue, which helped the development of this project to a great
extent. This project will continue to be open source and updated regularly.
Introduction
A Python wrapper of ZXing library. python-zxing does not work properly and is out of
maintenance. So I decide to create this repository so that Pythoneers can take advantage of ZXing library with minimum
effort.
Features
Super easy to get hands on decoding qrcode with Python
Structured outputs
Scan multiple barcodes in one picture
Scan multiple pictures in parallel, which speeds up 77%
A ready-to-go jar file is available with release, but I can not guarantee that this file will work properly on your PC.
You may run test script before building ZXing. Pyzxing will download compiled Jar file automatically and call unit test.
For those who haven't installed Java, I strongly recommend you to install openjdk8.
python -m unittest tests.test_decode
If failed, build ZXing using following commands.
git submodule init
git submodule update
cd zxing
mvn install -DskipTests
cd javase
mvn -DskipTests package assembly:single
Quick Start
frompyzxingimportBarCodeReaderreader=BarCodeReader()
results=reader.decode('/PATH/TO/FILE')
# Or file pattern for multiple filesresults=reader.decode('/PATH/TO/FILES/*.png')
print(results)
# Or a numpy array# Requires additional installation of opencv# pip install opencv-pythonresults=reader.decode_array(img)
Or you may simply call it from command line
python scripts/scanner.py -f /PATH/TO/FILE
Star History
About
Python wrapper of ZXing Java library, making qrcode decoding super easy!