Skip to content

Upgrading

When major versions of Biip are released, we try to keep the upgrade path as smooth as possible. However, there are some breaking changes that you need to consider when upgrading from one major version to another.

Upgrading from 3.x to 4.x

Result objects are immutable

All the dataclasses returned by Biip are now immutable. This means that you can no longer set attributes on them after they are created.

biip.parse() no longer raises ParseError

biip.parse() no longer raises ParseError when all parsers fail. This means that you can remove the try/except block around any calls to biip.parse() and base your logic on the returned ParseResult. (PR #376)

All config passed via ParseConfig

All parser configuration options have been moved to the ParseConfig class. (PR #385)

Look for anywhere you use the old configuration options:

  • rcn_region,
  • rcn_verify_variable_measure, or
  • separator_chars

and replace them with a ParseConfig instance. For example, if you previously used:

result = biip.parse("0107032069804988100329|15210525", separator_chars=["|"])

You should now use:

config = biip.ParseConfig(separator_chars=["|"])
result = biip.parse("0107032069804988100329|15210525", config=config)

biip.gs1 module

biip.gtin module

biip.symbology module

Upgrading from 2.x to 3.x

Errors in GS1 element string data

Parsing and validation errors of GLNs, GTINs, and SSCCs nested inside GS1 element strings no longer raises ParseError. Instead, the exception message is exposed on the GS1ElementString class as the new fields gln_error, gtin_error, and sscc_error.

This is a breaking change, but makes it possible to extract some information from GS1 Element Strings that are not entirely valid. (Fixes: #157, PR: #169)

Removed APIs

  • Removed RcnRegion.from_iso_3166_1_numeric_code() method which as been deprecated since Biip 2.2. (Fixes: #161, PR: #166)

Upgrading from 1.x to 2.x

Prefixes may be missing

  • When a prefix looks valid but cannot be found in Biip's list of known GS1 prefixes GS1Prefix.extract() now returns None instead of raising an exception. (Fixes: #93, PR: #94)

  • Following from the above, Gtin.prefix and Sscc.prefix can now be None. This makes it possible to parse and validate GTINs and SSCCs with prefixes missing from Biip's list of known GS1 prefixes. (Fixes: #93, PR: #94)

Removed APIs