Browse our Products

Aspose.BarCode for Python via Java 26.2

All Changes

KeySummaryCategory
BARCODENET-38024Remove EnableEscape propertyEnhancement
BARCODENET-39421Expose BarCodeReader.barcode_read_type as public methodEnhancement

Public API changes and New Features

Python API redesign

The Python API has been redesigned to follow Python language conventions. This release introduces breaking changes and is not backward compatible with previous versions.

Breaking changes

The API is not backward compatible with previous versions. Existing Python projects must update imports, method names and property access according to the new API conventions.

Module rename

The root module was renamed:

asposebarcode  aspose_barcode

All imports must be updated. Example: Old

from asposebarcode import BarCodeReader
from asposebarcode import BarcodeGenerator

New

from aspose_barcode.recognition import BarCodeReader
from aspose_barcode.generation import BarcodeGenerator

Package structure changes

Classes were reorganized into dedicated subpackages:

PackagePurpose
generationbarcode generation API
recognitionbarcode recognition API
complex_barcodecomplex barcode API
corecore barcode API

Classes can no longer be imported from the root module.

Class and file layout

The internal module layout now follows Python conventions:

  • each class is located in a separate file
  • file names follow the snake_case naming style
  • modules are organized as real Python packages instead of grouped source files

Naming convention changes

The public API now follows Python naming conventions.

  • CamelCase method names → snake_case
  • camelCase members → snake_case
  • properties follow Python naming style

Examples:

ReadBarCodes()  read_barcodes()
GetCodeText()  code_text
GetParameters()  parameters
Save()  save()

Properties instead of getters/setters

Accessor methods were removed and replaced with Python properties.

Old

text = result.getCodeText()
height = generator.getParameters().getBarcode().getBarHeight()

New

text = result.code_text
height = generator.parameters.barcode.bar_height

Removal of get/set accessor methods

The following accessor patterns were removed:

getX()
setX()
isX()

These are now replaced with property access:

x

Constructor changes

Constructors were simplified and updated to follow Python initialization patterns. Example: Old

reader = BarCodeReader(image, None, DecodeType.CODE_128)

New

reader = BarCodeReader(image, DecodeType.CODE_128)

Additional constructors are provided for advanced scenarios:

reader = BarCodeReader.from_image_with_areas(image, [10,10,100,100], DecodeType.CODE_128)

File structure changes

Classes can no longer be imported from the root module.

Old

from asposebarcode import *

New

from aspose_barcode.generation import BarcodeGenerator
from aspose_barcode.recognition import BarCodeReader

Usage examples

Barcode generation:

from aspose_barcode import generation
generator = generation.barcode_generator.BarcodeGenerator(generation.encode_types.EncodeTypes.QR, "Hello!")
params = generator.parameters
params.auto_size_mode = generation.auto_size_mode.AutoSizeMode.NEAREST
params.image_height.millimeters = 45
params.image_width.millimeters = 45
params.barcode.codetext_parameters.location = generation.code_location.CodeLocation.NONE
pil_image = generator.generate_barcode_image()

Barcode recognition:

from aspose_barcode import recognition

reader = recognition.barcode_reader.BarCodeReader("/image.jpg", recognition.decode_type.DecodeType.GS_1_CODE_128)
reader.quality_settings = recognition.quality_settings.QualitySettings.high_performance()
barcode_results = reader.read_barcodes()
print(reader.found_barcodes[0].code_text)