Skip to main content

A PDF417 barcode decoder

Project description

pdf417decoder

Image of a PDF417 barcode

pdf417decoder is a pure Python library for decoding PDF417 barcodes.

Reader is capable of Error Detection and Correction according to the standards for PDF417 which you can read about here ISO/IEC 15438:2006 or download an older version of the PDF this website.

Installation

Use the package manager pip to install pdf417decoder.

pip install pdf417decoder

Usage

from PIL import Image as PIL
from pdf417decoder import PDF417Decoder

image = PIL.open("barcode.png")
decoder = PDF417Decoder(image)

if (decoder.decode() > 0):
    decoded = decoder.barcode_data_index_to_string(0)

Testing Results

This library was tested using pdf417gen to create random barcodes and blurred with OpenCV to test error correction. PyTest is used with several test images to show the libraries capability to decode barcodes in the following test cases.

  • Binary data
  • Multiple barcodes
  • Upside down barcode
  • Rotated barcode
  • Error Corrections: Corrupted data due to blurred barcode
  • Error Corrections: Missing data due marks concealing barcode
  • Character type transitions (Upper, Lower, Mixed and Punctuation)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

CPOL

This project is a derivative of code licensed under the Code Project Open License (CPOL). The Code Project Open License (CPOL) is intended to provide developers who choose to share their code with a license that protects them and provides users of their code with a clear statement regarding how the code can be used.

Credits

Source code is a port of a C# Library created and maintained by Uzi Granot. PDF417 Barcode Decoder .NET Class Library and Two Demo Apps

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

pdf417decoder-1.0.7.tar.gz (37.3 kB view details)

Uploaded Source

Built Distribution

pdf417decoder-1.0.7-py3-none-any.whl (36.9 kB view details)

Uploaded Python 3

File details

Details for the file pdf417decoder-1.0.7.tar.gz.

File metadata

  • Download URL: pdf417decoder-1.0.7.tar.gz
  • Upload date:
  • Size: 37.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for pdf417decoder-1.0.7.tar.gz
Algorithm Hash digest
SHA256 ff3daaaf2bf5e0e3991fa5f3e61c0d7ac710dd3ca3f8bf4973131350af96a8e1
MD5 6720784902ca031bf38a0bb23e1be33c
BLAKE2b-256 69a5a53149a9a90df085ac518e6a0d8b7bf577a426439e8c6392bb08d6bb601e

See more details on using hashes here.

File details

Details for the file pdf417decoder-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: pdf417decoder-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 36.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for pdf417decoder-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7c90897ffd6e72b6a2e2e9ce4275a528847d2e0c6f3f19021cec29cd82cbaafa
MD5 89f1f38594bc037d7b36d1a11e86bd73
BLAKE2b-256 42d50037892ed38052ffae44677a9e599e45df5f44b66ab5aeeaad088bbca3f2

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