Skip to main content

Real time Barcode and QR Code scanner Edit

Project description

zbarcam

Build Status PyPI version Documentation Status

Real time Barcode and QR Code scanner using the camera. It's built on top of Kivy and pyzbar.

screenshot

How to use

Simply import and instanciate ZBarCam in your kvlang file and access its symbols property.

#:import ZBarCam kivy_garden.zbarcam.ZBarCam
#:import ZBarSymbol pyzbar.pyzbar.ZBarSymbol
BoxLayout:
    orientation: 'vertical'
    ZBarCam:
        id: zbarcam
        # optional, by default checks all types
        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):

sudo apt install libzbar-dev

Install garden requirements:

garden install --upgrade xcamera

Install zbarcam:

pip install --upgrade https://github.com/kivy-garden/zbarcam/archive/develop.zip

Then import it in your Python code via:

from kivy_garden.zbarcam import ZBarCam

You may also need to compile/install OpenCV manually, see OpenCV.md.

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

Install Unable to import package 'kivy.garden.xcamera.XCamera'

You're missing the xcamera dependency. Install it as described in the install instructions.

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.

OpenCV related

See OpenCV.md.

Credits

I borrowed a lot of code from tito/android-zbar-qrcode.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kivy_garden.zbarcam-2019.907.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

kivy_garden.zbarcam-2019.907-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file kivy_garden.zbarcam-2019.907.tar.gz.

File metadata

  • Download URL: kivy_garden.zbarcam-2019.907.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for kivy_garden.zbarcam-2019.907.tar.gz
Algorithm Hash digest
SHA256 5e9d9e9786dc8db37b6849d93416f24c426af5d71697132d5b372bb448cb5eab
MD5 052decdfc07efaf62cd7ec50755b0c52
BLAKE2b-256 65407a3d5d5b70c82813178d53d934373b1b172086025de77bc0c2bfb5d6008a

See more details on using hashes here.

File details

Details for the file kivy_garden.zbarcam-2019.907-py3-none-any.whl.

File metadata

  • Download URL: kivy_garden.zbarcam-2019.907-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for kivy_garden.zbarcam-2019.907-py3-none-any.whl
Algorithm Hash digest
SHA256 d43ca0b4b1eadf602b3e8ff1dc8e17825a696e4b98ba0c9280f118c12e80d330
MD5 9753ac414df8930590996924e4385ee1
BLAKE2b-256 c7294dd3ae748f8d38cc86e595e453229e76e1fc26269d9e04ce124f2d547980

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page