This release contains a couple of breaking changes, thus the version bump to 3.0.
Breaking changes
- 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)
- Remove `RcnRegion.from_iso_3166_1_numeric_code()` class method which as been deprecated since Biip 2.2. (Fixes: 161, PR: 166)
GS1 Company Prefix support
- Add `GS1CompanyPrefix` class that can extract the company prefix from any GLN, GTIN, or SSCC. This is based on a data set from GS1 that is bundled with Biip, just like the GS1 Prefixes and GS1 Application Identifiers. The data set is preprocessed into a trie data structure, making company prefix length lookups fast. (Fixes: 160, PR: 172)
- Add and set `company_prefix` fields on the `Gln`, `Gtin`, and `Sssc` classes, based on the new `GS1CompanyPrefix` class. (Fixes: 160, PR: 174)
- Change `Sscc.as_hri()` to use `GS1CompanyPrefix` to automatically group the company prefix and the serial when rendering SSCC's for human consumption. The existing `company_prefix_length` parameter is now only used as an override in case you're rendering an SSCC whose company prefix is not included in the data set yet, or where you disagree with the data set. (Fixes: 160, PR: 173)
Other changes
- Add `rcn_verify_variable_measure` parameter to all functions and methods taking `rcn_region` as a parameter. The parameter defaults to `True` and the old behavior. By setting this parameter to `False`, it is possible to parse and extract variable measure from RCNs that have separate check digit for the variable measure, but where the check digit is either incorrect or simply not in use as a check digit. This parameter only has any effect on RCN regions with formats including check digits, e.g. Great Britain and Germany. (PR: 171)
- Update the bundled GS1 Application Identifier definitions. (PR: 164)
- Update the bundled GS1 Prefix definitions, and add script to automate future updates. (PR: 165)
- Add Python 3.11 to the test matrix, and updated development tooling. (PR: 163)
If you're using Biip, please add yourself to the [list of users](https://github.com/jodal/biip/wiki/Users)!