Recognize Barcode via Python

Read 1D, 2D and Postal barcodes including Code 128, UPC-A, ISBN, EAN-8, EAN-13, EAN-14 and more within Python applications.

 

Barocdes are the necessity of various businesses so as the softwares handling those businesses. Aspose.BarCode for Python via .NET API that is part of Aspose.Total for Python via .NET APIs package, provides different features to address such businesses needs. API is able to read barcodes from images of any quality at any angle. Moreover, It can decode non-English characters in 2D types. Procedure of reading barcode is simple and listed below.

How to Recognize Barcode using Python

For reading and scanning barcode of any symbology, API provides the BarCodeReader class that takes the Decoding types as parameter or use the generic DecodeType.AllSupportedTypes that handles all types. Call the read_bar_codes() method to read all the barcode text. Loop through all the scanned code characters. Finally do any relevant process such as print it to get the code or match with the stored codes within the database.

Python - Recognize BarCode

from aspose.barcode import barcoderecognition
reader = barcoderecognition.BarCodeReader(<file name>, barcoderecognition.DecodeType.AllSupportedTypes)
recognized_results = reader.read_bar_codes()
for barcode in recognized_results:
print(barcode.code_text)