File: codabar.py

package info (click to toggle)
python-barcode 0.15.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 684 kB
  • sloc: python: 1,661; makefile: 23; sh: 9
file content (25 lines) | stat: -rw-r--r-- 479 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# W = Wide bar
# w = wide space
# N = Narrow bar
# n = narrow space

CODES = {
    "0": "NnNnNwW",
    "1": "NnNnWwN",
    "2": "NnNwNnW",
    "3": "WwNnNnN",
    "4": "NnWnNwN",
    "5": "WnNnNwN",
    "6": "NwNnNnW",
    "7": "NwNnWnN",
    "8": "NwWnNnN",
    "9": "WnNwNnN",
    "-": "NnNwWnN",
    "$": "NnWwNnN",
    ":": "WnNnWnW",
    "/": "WnWnNnW",
    ".": "WnWnWnN",
    "+": "NnWnWnW",
}

STARTSTOP = {"A": "NnWwNwN", "B": "NwNwNnW", "C": "NnNwNwW", "D": "NnNwWwN"}