v2.0.0
This release contains a couple of breaking changes, thus the version bump to 2.0.
Breaking changes
- When a prefix looks valid but cannot be found in Biip's list of known GS1 Prefixes
GS1Prefix.extract()now returnsNoneinstead of raising an exception. (Fixes: #93, PR: #94) - Following from the above,
Gtin.prefixandSscc.prefixcan now beNone. 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) - The deprecated RCN region
RcnRegion.BALTICShas been removed. UseESTONIA,LATVIA, orLITHUANIAinstead. (PR: #100)
Bug fixes
- Parsing a GTIN-14 can no longer return the
Rcnsubclass. RCN is only defined for GTIN-8, GTIN-12, and GTIN-13. (PR: #96) Rcn.without_variable_measure()no longer zeroes out digits from RCNs without variable measures. (PR: #97)
Changes
- Added a no-op method
Gtin.without_variable_measure()so thatGtinandRcninstances can be used interchangeably in more cases. This should reduce the need forisinstance(gtin, Rcn)checks. - The RCN rules are now defined in a declarative data structure, making it a lot easier to contribute RCN rules for new geographical regions. (PR: #98)
- Added
FINLANDas a supported RCN region. (PR: #95)
If you're using Biip, please add yourself to the new list of users!