MCPcopy Index your code
hub / github.com/WhyNotHugo/python-barcode / Gs1_128

Class Gs1_128

barcode/codex.py:285–305  ·  view source on GitHub ↗

following the norm, a gs1-128 barcode is a subset of code 128 barcode, it can be generated by prepending the code with the FNC1 character https://en.wikipedia.org/wiki/GS1-128 https://www.gs1-128.info/

Source from the content-addressed store, hash-verified

283
284
285class Gs1_128(Code128): # noqa: N801
286 """
287 following the norm, a gs1-128 barcode is a subset of code 128 barcode,
288 it can be generated by prepending the code with the FNC1 character
289 https://en.wikipedia.org/wiki/GS1-128
290 https://www.gs1-128.info/
291 """
292
293 name = "GS1-128"
294
295 FNC1_CHAR = "\xf1"
296
297 def __init__(self, code, writer=None) -> None:
298 code = self.FNC1_CHAR + code
299 super().__init__(code, writer)
300
301 def get_fullcode(self):
302 return super().get_fullcode()[1:]
303
304 def _is_char_fnc1_char(self, char):
305 return char == self.FNC1_CHAR
306
307
308# For pre 0.8 compatibility

Callers 1

test_code_buildFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_code_buildFunction · 0.72