Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kivy-garden/zbarcam
Real time Barcode and QR Code scanner
https://github.com/kivy-garden/zbarcam
Last synced: 2 days ago
JSON representation
Real time Barcode and QR Code scanner
- Host: GitHub
- URL: https://github.com/kivy-garden/zbarcam
- Owner: kivy-garden
- License: mit
- Created: 2019-08-30T20:39:33.000Z (over 5 years ago)
- Default Branch: develop
- Last Pushed: 2024-04-03T08:06:17.000Z (9 months ago)
- Last Synced: 2024-12-15T20:25:05.955Z (9 days ago)
- Language: Python
- Size: 1.36 MB
- Stars: 129
- Watchers: 14
- Forks: 33
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# zbarcam
[![Build Status](https://travis-ci.org/kivy-garden/zbarcam.svg?branch=develop)](https://travis-ci.org/kivy-garden/zbarcam)
[![Coverage Status](https://coveralls.io/repos/github/kivy-garden/zbarcam/badge.svg?branch=develop)](https://coveralls.io/github/kivy-garden/zbarcam?branch=develop)
[![PyPI version](https://badge.fury.io/py/zbarcam.svg)](https://badge.fury.io/py/zbarcam)
[![Documentation Status](https://readthedocs.org/projects/zbarcam/badge/?version=latest)](https://zbarcam.readthedocs.io/en/latest/?badge=latest)Real time Barcode and QR Code scanner using the camera.
It's built on top of [Kivy](https://github.com/kivy/kivy) and works with both [pyzbar](https://github.com/NaturalHistoryMuseum/pyzbar) or [zbarlight](https://github.com/Polyconseil/zbarlight).## How to use
Simply import and instanciate `ZBarCam` in your kvlang file and access its `symbols` property.
```yaml
#:import ZBarCam kivy_garden.zbarcam.ZBarCam
BoxLayout:
orientation: 'vertical'
ZBarCam:
id: zbarcam
# optional, by default checks all types
code_types: 'QRCODE', '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](https://github.com/kivy-garden/zbarcam/blob/master/src/main.py).## Install
### Ubuntu
Install system requirements (Ubuntu 18.04):
```sh
make system_dependencies
```Install zbarcam:
```sh
pip install zbarcam
```
Then import it in your Python code via:
```python
from kivy_garden.zbarcam import ZBarCam
```### Android
Build for Android via buildozer, see [buildozer.spec](buildozer.spec).## Contribute
To play with the project, install system dependencies and Python requirements using the [Makefile](Makefile).
```sh
make
```
Then verify everything is OK by running tests.
```sh
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.