Primer commit
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,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"}
|
||||
216
venv/lib/python3.11/site-packages/barcode/charsets/code128.py
Normal file
216
venv/lib/python3.11/site-packages/barcode/charsets/code128.py
Normal file
@@ -0,0 +1,216 @@
|
||||
import string
|
||||
|
||||
# Charsets for code 128
|
||||
|
||||
_common = (
|
||||
" ",
|
||||
"!",
|
||||
'"',
|
||||
"#",
|
||||
"$",
|
||||
"%",
|
||||
"&",
|
||||
"'",
|
||||
"(",
|
||||
")",
|
||||
"*",
|
||||
"+",
|
||||
",",
|
||||
"-",
|
||||
".",
|
||||
"/",
|
||||
*tuple(string.digits),
|
||||
":",
|
||||
";",
|
||||
"<",
|
||||
"=",
|
||||
">",
|
||||
"?",
|
||||
"@",
|
||||
*tuple(string.ascii_uppercase),
|
||||
"[",
|
||||
"\\",
|
||||
"]",
|
||||
"^",
|
||||
"_",
|
||||
)
|
||||
|
||||
_charset_a = (
|
||||
*_common,
|
||||
"\x00",
|
||||
"\x01",
|
||||
"\x02",
|
||||
"\x03",
|
||||
"\x04",
|
||||
"\x05",
|
||||
"\x06",
|
||||
"\x07",
|
||||
"\x08",
|
||||
"\t",
|
||||
"\n",
|
||||
"\x0b",
|
||||
"\x0c",
|
||||
"\r",
|
||||
"\x0e",
|
||||
"\x0f",
|
||||
"\x10",
|
||||
"\x11",
|
||||
"\x12",
|
||||
"\x13",
|
||||
"\x14",
|
||||
"\x15",
|
||||
"\x16",
|
||||
"\x17",
|
||||
"\x18",
|
||||
"\x19",
|
||||
"\x1a",
|
||||
"\x1b",
|
||||
"\x1c",
|
||||
"\x1d",
|
||||
"\x1e",
|
||||
"\x1f",
|
||||
"ó",
|
||||
"ò",
|
||||
"SHIFT",
|
||||
"TO_C",
|
||||
"TO_B",
|
||||
"ô",
|
||||
"ñ",
|
||||
)
|
||||
|
||||
_charset_b = (
|
||||
*_common,
|
||||
"`",
|
||||
*tuple(string.ascii_lowercase),
|
||||
"{",
|
||||
"|",
|
||||
"}",
|
||||
"~",
|
||||
"\x7f",
|
||||
"ó",
|
||||
"ò",
|
||||
"SHIFT",
|
||||
"TO_C",
|
||||
"ô",
|
||||
"TO_A",
|
||||
"ñ",
|
||||
)
|
||||
|
||||
ALL = set(_common + _charset_a + _charset_b)
|
||||
A = {c: i for i, c in enumerate(_charset_a)}
|
||||
B = {c: i for i, c in enumerate(_charset_b)}
|
||||
C = {"TO_B": 100, "TO_A": 101, "\xf1": 102}
|
||||
|
||||
CODES = (
|
||||
"11011001100",
|
||||
"11001101100",
|
||||
"11001100110",
|
||||
"10010011000",
|
||||
"10010001100",
|
||||
"10001001100",
|
||||
"10011001000",
|
||||
"10011000100",
|
||||
"10001100100",
|
||||
"11001001000",
|
||||
"11001000100",
|
||||
"11000100100",
|
||||
"10110011100",
|
||||
"10011011100",
|
||||
"10011001110",
|
||||
"10111001100",
|
||||
"10011101100",
|
||||
"10011100110",
|
||||
"11001110010",
|
||||
"11001011100",
|
||||
"11001001110",
|
||||
"11011100100",
|
||||
"11001110100",
|
||||
"11101101110",
|
||||
"11101001100",
|
||||
"11100101100",
|
||||
"11100100110",
|
||||
"11101100100",
|
||||
"11100110100",
|
||||
"11100110010",
|
||||
"11011011000",
|
||||
"11011000110",
|
||||
"11000110110",
|
||||
"10100011000",
|
||||
"10001011000",
|
||||
"10001000110",
|
||||
"10110001000",
|
||||
"10001101000",
|
||||
"10001100010",
|
||||
"11010001000",
|
||||
"11000101000",
|
||||
"11000100010",
|
||||
"10110111000",
|
||||
"10110001110",
|
||||
"10001101110",
|
||||
"10111011000",
|
||||
"10111000110",
|
||||
"10001110110",
|
||||
"11101110110",
|
||||
"11010001110",
|
||||
"11000101110",
|
||||
"11011101000",
|
||||
"11011100010",
|
||||
"11011101110",
|
||||
"11101011000",
|
||||
"11101000110",
|
||||
"11100010110",
|
||||
"11101101000",
|
||||
"11101100010",
|
||||
"11100011010",
|
||||
"11101111010",
|
||||
"11001000010",
|
||||
"11110001010",
|
||||
"10100110000",
|
||||
"10100001100",
|
||||
"10010110000",
|
||||
"10010000110",
|
||||
"10000101100",
|
||||
"10000100110",
|
||||
"10110010000",
|
||||
"10110000100",
|
||||
"10011010000",
|
||||
"10011000010",
|
||||
"10000110100",
|
||||
"10000110010",
|
||||
"11000010010",
|
||||
"11001010000",
|
||||
"11110111010",
|
||||
"11000010100",
|
||||
"10001111010",
|
||||
"10100111100",
|
||||
"10010111100",
|
||||
"10010011110",
|
||||
"10111100100",
|
||||
"10011110100",
|
||||
"10011110010",
|
||||
"11110100100",
|
||||
"11110010100",
|
||||
"11110010010",
|
||||
"11011011110",
|
||||
"11011110110",
|
||||
"11110110110",
|
||||
"10101111000",
|
||||
"10100011110",
|
||||
"10001011110",
|
||||
"10111101000",
|
||||
"10111100010",
|
||||
"11110101000",
|
||||
"11110100010",
|
||||
"10111011110",
|
||||
"10111101110",
|
||||
"11101011110",
|
||||
"11110101110",
|
||||
"11010000100",
|
||||
"11010010000",
|
||||
"11010011100",
|
||||
)
|
||||
|
||||
STOP = "11000111010"
|
||||
|
||||
START_CODES = {"A": 103, "B": 104, "C": 105}
|
||||
TO = {101: START_CODES["A"], 100: START_CODES["B"], 99: START_CODES["C"]}
|
||||
61
venv/lib/python3.11/site-packages/barcode/charsets/code39.py
Normal file
61
venv/lib/python3.11/site-packages/barcode/charsets/code39.py
Normal file
@@ -0,0 +1,61 @@
|
||||
import string
|
||||
|
||||
# Charsets for code 39
|
||||
REF = (
|
||||
tuple(string.digits)
|
||||
+ tuple(string.ascii_uppercase)
|
||||
+ ("-", ".", " ", "$", "/", "+", "%")
|
||||
)
|
||||
B = "1"
|
||||
E = "0"
|
||||
CODES = (
|
||||
"101000111011101",
|
||||
"111010001010111",
|
||||
"101110001010111",
|
||||
"111011100010101",
|
||||
"101000111010111",
|
||||
"111010001110101",
|
||||
"101110001110101",
|
||||
"101000101110111",
|
||||
"111010001011101",
|
||||
"101110001011101",
|
||||
"111010100010111",
|
||||
"101110100010111",
|
||||
"111011101000101",
|
||||
"101011100010111",
|
||||
"111010111000101",
|
||||
"101110111000101",
|
||||
"101010001110111",
|
||||
"111010100011101",
|
||||
"101110100011101",
|
||||
"101011100011101",
|
||||
"111010101000111",
|
||||
"101110101000111",
|
||||
"111011101010001",
|
||||
"101011101000111",
|
||||
"111010111010001",
|
||||
"101110111010001",
|
||||
"101010111000111",
|
||||
"111010101110001",
|
||||
"101110101110001",
|
||||
"101011101110001",
|
||||
"111000101010111",
|
||||
"100011101010111",
|
||||
"111000111010101",
|
||||
"100010111010111",
|
||||
"111000101110101",
|
||||
"100011101110101",
|
||||
"100010101110111",
|
||||
"111000101011101",
|
||||
"100011101011101",
|
||||
"100010001000101",
|
||||
"100010001010001",
|
||||
"100010100010001",
|
||||
"101000100010001",
|
||||
)
|
||||
|
||||
EDGE = "100010111011101"
|
||||
MIDDLE = "0"
|
||||
|
||||
# MAP for assigning every symbol (REF) to (reference number, barcode)
|
||||
MAP = dict(zip(REF, enumerate(CODES)))
|
||||
52
venv/lib/python3.11/site-packages/barcode/charsets/ean.py
Normal file
52
venv/lib/python3.11/site-packages/barcode/charsets/ean.py
Normal file
@@ -0,0 +1,52 @@
|
||||
EDGE = "101"
|
||||
MIDDLE = "01010"
|
||||
CODES = {
|
||||
"A": (
|
||||
"0001101",
|
||||
"0011001",
|
||||
"0010011",
|
||||
"0111101",
|
||||
"0100011",
|
||||
"0110001",
|
||||
"0101111",
|
||||
"0111011",
|
||||
"0110111",
|
||||
"0001011",
|
||||
),
|
||||
"B": (
|
||||
"0100111",
|
||||
"0110011",
|
||||
"0011011",
|
||||
"0100001",
|
||||
"0011101",
|
||||
"0111001",
|
||||
"0000101",
|
||||
"0010001",
|
||||
"0001001",
|
||||
"0010111",
|
||||
),
|
||||
"C": (
|
||||
"1110010",
|
||||
"1100110",
|
||||
"1101100",
|
||||
"1000010",
|
||||
"1011100",
|
||||
"1001110",
|
||||
"1010000",
|
||||
"1000100",
|
||||
"1001000",
|
||||
"1110100",
|
||||
),
|
||||
}
|
||||
LEFT_PATTERN = (
|
||||
"AAAAAA",
|
||||
"AABABB",
|
||||
"AABBAB",
|
||||
"AABBBA",
|
||||
"ABAABB",
|
||||
"ABBAAB",
|
||||
"ABBBAA",
|
||||
"ABABAB",
|
||||
"ABABBA",
|
||||
"ABBABA",
|
||||
)
|
||||
19
venv/lib/python3.11/site-packages/barcode/charsets/itf.py
Normal file
19
venv/lib/python3.11/site-packages/barcode/charsets/itf.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# W = Wide bar
|
||||
# w = wide space
|
||||
# N = Narrow bar
|
||||
# n = narrow space
|
||||
|
||||
START = "NnNn"
|
||||
STOP = "WnN"
|
||||
CODES = (
|
||||
"NNWWN",
|
||||
"WNNNW",
|
||||
"NWNNW",
|
||||
"WWNNN",
|
||||
"NNWNW",
|
||||
"WNWNN",
|
||||
"NWWNN",
|
||||
"NNNWW",
|
||||
"WNNWN",
|
||||
"NWNWN",
|
||||
)
|
||||
28
venv/lib/python3.11/site-packages/barcode/charsets/upc.py
Normal file
28
venv/lib/python3.11/site-packages/barcode/charsets/upc.py
Normal file
@@ -0,0 +1,28 @@
|
||||
EDGE = "101"
|
||||
MIDDLE = "01010"
|
||||
CODES = {
|
||||
"L": (
|
||||
"0001101",
|
||||
"0011001",
|
||||
"0010011",
|
||||
"0111101",
|
||||
"0100011",
|
||||
"0110001",
|
||||
"0101111",
|
||||
"0111011",
|
||||
"0110111",
|
||||
"0001011",
|
||||
),
|
||||
"R": (
|
||||
"1110010",
|
||||
"1100110",
|
||||
"1101100",
|
||||
"1000010",
|
||||
"1011100",
|
||||
"1001110",
|
||||
"1010000",
|
||||
"1000100",
|
||||
"1001000",
|
||||
"1110100",
|
||||
),
|
||||
}
|
||||
Reference in New Issue
Block a user