zbarcam
Real time Barcode and QR Code scanner using the camera.
It's built on top of Kivy and pyzbar.
How to use
Simply import and instanciate ZBarCam
in your kvlang file and access its symbols
property.
BoxLayout:
orientation: 'vertical'
ZBarCam:
id: zbarcam
code_types: ZBarSymbol.QRCODE, ZBarSymbol.EAN13
Label:
size_hint: None, None
size: self.texture_size[0], 50
text: ', '.join([str(symbol.data) for symbol in zbarcam.symbols])
A full working demo is available in src/main.py.
Install
Ubuntu
Install system requirements (Ubuntu 18.04):
make system_dependencies
Install zbarcam:
pip install zbarcam
Then import it in your Python code via:
from kivy_garden.zbarcam import ZBarCam
Android
Build for Android via buildozer, see buildozer.spec.
Contribute
To play with the project, install system dependencies and Python requirements using the Makefile.
make
Then verify everything is OK by running tests.
make test
make uitest
Troubleshooting
Android ValueError: Empty module name
More likely an import issue in your .kv
file.
Try to from zbarcam import ZBarCam
in your main.py
to see the exact error.
It's common to forget Pillow
in buildozer.spec
requirements
section.