steenzout.barcode.codex module

Module: barcode.codex

Provided barcodes:
 Code 39, Code 128, PZN
class Code128(code, writer=None)[source]

Bases: steenzout.barcode.base.Barcode

Initializes a new Code128 instance. The checksum is added automatically when building the bars.

Parameters:
  • code (str) – code 128 string without checksum (added automatically).
  • writer (writer.BaseWriter) – instance of writer class to render the bar code.
build()[source]
static calculate_checksum(code)[source]
encoded
get_fullcode()[source]
name = 'Code 128'
render(writer_options=None)[source]
static validate(code)[source]
class Code39(code, writer=None)[source]

Bases: steenzout.barcode.base.Barcode

Initializes a new Code39 instance.

code

str

writer

writer.BaseWriter

writer class.

Parameters:
  • code (str) – Code 39 string without * and checksum (added automatically if add_checksum is True).
  • writer (writer Instance) – instance of writer class to render the bar code.
  • add_checksum (bool) – add the checksum to code or not.
build()[source]
static calculate_checksum(code)[source]
get_fullcode()[source]
name = 'Code 39'
render(writer_options=None)[source]
static validate(code)[source]
class PZN(code, writer=None)[source]

Bases: steenzout.barcode.codex.Code39

Initializes new German number for pharmaceutical products.

Parameters:
  • pzn (str) – code to render.
  • writer (writer.BaseWriter) – instance of writer class to render the bar code.
build()[source]
static calculate_checksum(code)[source]
code39()[source]
digits = 6
get_fullcode()[source]
name = 'Pharmazentralnummer'
static validate(code)[source]
check_code(code, name, allowed)[source]