Skip to main content

Python wrapper for ZXing Java library

Project description

pyzxing

English | 简体中文

GitHub release (latest by date including pre-releases) PyPI Conda

Travis (.org) Codacy grade

First GA

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%

Installation

Installing from Github source is recommended :

git clone https://github.com/ChenjieXu/pyzxing.git
cd pyzxing
python setup.py install

It is also possible to install from PyPI:

pip install pyzxing

Install from Anaconda:

conda install -c chenjiexu pyzxing

Build ZXing Library

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 src.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

from pyzxing import BarCodeReader

reader = BarCodeReader()
results = reader.decode('/PATH/TO/FILE')
# Or file pattern for multiple files
results = reader.decode('/PATH/TO/FILES/*.png')
print(results)
# Or a numpy array
# Requires additional installation of opencv
# pip install opencv-python
results = reader.decode_array(img)

Or you may simply call it from command line

python scanner.py -f /PATH/TO/FILE

Sponsor

Logo
Open Source Support Program

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

pyzxing-1.0.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

pyzxing-1.0.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file pyzxing-1.0.1.tar.gz.

File metadata

  • Download URL: pyzxing-1.0.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for pyzxing-1.0.1.tar.gz
Algorithm Hash digest
SHA256 89defa1544879844d1a82b5052e886c274731d13b65ec5044ec927dc97bb1028
MD5 a206d37d27fb5c8cc980b271c45e86f5
BLAKE2b-256 4e1df0503f3e2a7e0179f62d02acf2f0e5b8655c722bf0ef0f0d8ed644a9ab75

See more details on using hashes here.

File details

Details for the file pyzxing-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyzxing-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for pyzxing-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c402aa7f23aeed1e5d4681b8a9cfbcb673d9c7d9848a28f0c96f458e7fa17e38
MD5 22c2e932e22e423aeb43f53a2e62f4e8
BLAKE2b-256 4ee37fe7cd896390281d6f309e09d373b5ff2a66074e893e77e42a88514487b1

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