ean-tools 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ean_tools/normalization.py
CHANGED
@@ -19,7 +19,7 @@ def normalize_barcode(barcode: str, is_isbn: Optional[bool] = None) -> str:
|
|
19
19
|
ValueError: If the barcode is invalid or ambiguous.
|
20
20
|
"""
|
21
21
|
barcode = re.sub(r'[\s-]', '', barcode)
|
22
|
-
if not barcode or not barcode.
|
22
|
+
if not barcode or not barcode.isdecimal() or barcode == '0' * len(barcode):
|
23
23
|
raise ValueError("Doesn't look like a barcode")
|
24
24
|
|
25
25
|
barcode_len = len(barcode)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: ean-tools
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.1
|
4
4
|
Summary: Collection of tools for validating and getting information about EAN (UPC, GTIN) and ISBN barcodes.
|
5
5
|
Home-page: https://github.com/ean-db/ean-tools
|
6
6
|
License: MIT
|
@@ -25,7 +25,7 @@ Collection of tools for validating and getting information about EAN (UPC, GTIN)
|
|
25
25
|
## Installation
|
26
26
|
|
27
27
|
```commandline
|
28
|
-
pip install
|
28
|
+
pip install ean-tools
|
29
29
|
```
|
30
30
|
|
31
31
|
## Usage
|
@@ -5,7 +5,7 @@ ean_tools/check_digits.py,sha256=UZKDWJm6mSqNCOk_DDx9yrwCar70RCZsu9B86gHHwc8,127
|
|
5
5
|
ean_tools/data/gs1-8-prefixes.yaml,sha256=8_QfQic9KoEd91nTqT8UdbA5gDtKKSEkmvYepmyYh_A,374
|
6
6
|
ean_tools/data/gs1-prefixes.yaml,sha256=rEwlAPPCOgph-4PKuW5IkTE3EXbNmyvwfO9PHVKPsBA,10876
|
7
7
|
ean_tools/data/isbn-prefixes.yaml,sha256=ABFMVsiKa7TXLl9UPVJReN-DB6_0ka0qGfwSA71RC2U,11790
|
8
|
-
ean_tools/normalization.py,sha256=
|
9
|
-
ean_tools-0.1.
|
10
|
-
ean_tools-0.1.
|
11
|
-
ean_tools-0.1.
|
8
|
+
ean_tools/normalization.py,sha256=MJh1pTpX_B6pd67NkwG5mo5tZVeIvAEIkQZuDb-onTk,2236
|
9
|
+
ean_tools-0.1.1.dist-info/METADATA,sha256=5wIdAQT_Kc9A63yAWWuq1in2sNCP3TKbicir5TQu_nc,1524
|
10
|
+
ean_tools-0.1.1.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
|
11
|
+
ean_tools-0.1.1.dist-info/RECORD,,
|
File without changes
|