Skip to content

Implement PZN8 - #188

Open
fostermaier wants to merge 8 commits into
WhyNotHugo:mainfrom
fostermaier:main
Open

Implement PZN8#188
fostermaier wants to merge 8 commits into
WhyNotHugo:mainfrom
fostermaier:main

Conversation

@fostermaier

Copy link
Copy Markdown
Contributor

Implement PZN8 code generation. Fixes#167.

  • keeping PZN for PZN7, implementing PZN8 for PZN8
  • checksum is commonly part of the PZN* code. Hence, we verify or append the checksum based on the length of the supplied PZN7 or PZN8 code.
  • explicit error messages concerning code length for both classes respectively
  • different checksum calculation for PZN8. see http://www.pruefziffernberechnung.de/P/PZN.shtml

usage

check code length

>>> PZN('12345678')
barcode.errors.NumberOfDigitsError: PZN7 must have 6 digits (excluding checksum) or 7 digits (including checksum), not 8.
>>> PZN8('123456789')
barcode.errors.NumberOfDigitsError: PZN8 must have 7 digits (excluding checksum) or 8 digits (including checksum), not 9.

auto-append checksum

>>> PZN('123456')
<PZN7('PZN-1234562')>
>>> PZN8('1234567')
<PZN8('PZN-12345678')>

verify checksum if supplied

>>> PZN('1234568')
barcode.errors.BarcodeError: Checksum (last digit) is not valid for the supplied PZN7 code.
>>> PZN('1234562')
<PZN7('PZN-1234562')>

resources (mostly german)

samples

PZN7: https://barcode.tec-it.com/de/Health_PZN7
pzn7

PZN8: https://www.softmatic.com/de/barcode-code-pzn.html
pzn8

fostermaierand others added 8 commits November 24, 2022 21:45
pass
'quiet_zone': 0,
'margin_top': 0,
'margin_bottom': 0,
for borderless codes
* verify or append checksum based on code length for PZN7 and PZN8
* explicit error messages for both classes respectively
* different checksum calculation for PZN8
@codecov

codecovBot commented Dec 1, 2022

Copy link
Copy Markdown

Codecov Report

Base: 80.63% // Head: 80.06% // Decreases project coverage by -0.56%⚠️

Coverage data is based on head (25cf372) compared to base (3643a65).
Patch coverage: 61.11% of modified lines in pull request are covered.

Additional details and impacted files
@@ Coverage Diff @@## main #188 +/- ##
==========================================
- Coverage 80.63% 80.06% -0.57% 
==========================================
Files 17 17 Lines 888 898 +10 ==========================================
+ Hits 716 719 +3 - Misses 172 179 +7 
Impacted FilesCoverage Δ
barcode/codex.py80.31% <58.82%> (-2.93%)⬇️
barcode/__init__.py96.00% <100.00%> (+0.08%)⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PZN8 support still in planning?

1 participant

@fostermaier