steenzout.barcode package

Module contents

This package provides a simple way to create standard bar codes.

It needs no external packages to be installed, the bar codes are created as SVG objects.

If PIL (Python Imaging Library) is installed, the bar codes can also be rendered as images (all formats supported by PIL).

encodings()[source]

Return bar code encodings available.

Returns:available bar code encodings.
Return type:(list[str])
formats()[source]

Return image formats available.

Returns:available image formats.
Return type:(list[‘str’])
generate(name, code, writer=None, output=None, writer_options=None)[source]

Generates a file containing an image of the bar code.

Parameters:
  • name (str) – bar code name.
  • code (str) – bar code.
  • writer (steenzout.barcode.writer.Interface) – writer instance.
  • output (str) – filename of output.
  • writer_options (dict) – options for the writer class.
Raises:

(BarcodeNotFoundError) – when the bar code encoding name is invalid or the encoding is not implemented.

version()[source]

Returns package version.

Returns:package version.
Return type:(str)