ean-tools 0.1.0__tar.gz → 0.1.1__tar.gz
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-0.1.0 → ean_tools-0.1.1}/PKG-INFO +2 -2
- {ean_tools-0.1.0 → ean_tools-0.1.1}/README.md +1 -1
- {ean_tools-0.1.0 → ean_tools-0.1.1}/ean_tools/normalization.py +1 -1
- {ean_tools-0.1.0 → ean_tools-0.1.1}/pyproject.toml +1 -1
- {ean_tools-0.1.0 → ean_tools-0.1.1}/ean_tools/__init__.py +0 -0
- {ean_tools-0.1.0 → ean_tools-0.1.1}/ean_tools/barcode_info.py +0 -0
- {ean_tools-0.1.0 → ean_tools-0.1.1}/ean_tools/barcode_prefixes.py +0 -0
- {ean_tools-0.1.0 → ean_tools-0.1.1}/ean_tools/check_digits.py +0 -0
- {ean_tools-0.1.0 → ean_tools-0.1.1}/ean_tools/data/gs1-8-prefixes.yaml +0 -0
- {ean_tools-0.1.0 → ean_tools-0.1.1}/ean_tools/data/gs1-prefixes.yaml +0 -0
- {ean_tools-0.1.0 → ean_tools-0.1.1}/ean_tools/data/isbn-prefixes.yaml +0 -0
@@ -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
|
@@ -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)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|