typeid-python 0.3.1__tar.gz → 0.3.2__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.
Potentially problematic release.
This version of typeid-python might be problematic. Click here for more details.
- {typeid_python-0.3.1 → typeid_python-0.3.2}/PKG-INFO +3 -3
- {typeid_python-0.3.1 → typeid_python-0.3.2}/pyproject.toml +3 -3
- typeid_python-0.3.2/typeid/errors.py +14 -0
- typeid_python-0.3.2/typeid/py.typed +0 -0
- {typeid_python-0.3.1 → typeid_python-0.3.2}/typeid/typeid.py +9 -5
- typeid_python-0.3.1/typeid/errors.py +0 -14
- {typeid_python-0.3.1 → typeid_python-0.3.2}/LICENSE +0 -0
- {typeid_python-0.3.1 → typeid_python-0.3.2}/README.md +0 -0
- {typeid_python-0.3.1 → typeid_python-0.3.2}/typeid/__init__.py +0 -0
- {typeid_python-0.3.1 → typeid_python-0.3.2}/typeid/base32.py +0 -0
- {typeid_python-0.3.1 → typeid_python-0.3.2}/typeid/cli.py +0 -0
- {typeid_python-0.3.1 → typeid_python-0.3.2}/typeid/constants.py +0 -0
- {typeid_python-0.3.1 → typeid_python-0.3.2}/typeid/validation.py +0 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: typeid-python
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Python implementation of TypeIDs: type-safe, K-sortable, and globally unique identifiers inspired by Stripe IDs
|
|
5
5
|
Home-page: https://github.com/akhundMurad/typeid-python
|
|
6
6
|
License: MIT
|
|
7
7
|
Keywords: typeid,uuid,uuid6,guid
|
|
8
8
|
Author: Murad Akhundov
|
|
9
9
|
Author-email: akhundov1murad@gmail.com
|
|
10
|
-
Requires-Python: >=3.
|
|
10
|
+
Requires-Python: >=3.9,<4
|
|
11
11
|
Classifier: Development Status :: 3 - Alpha
|
|
12
12
|
Classifier: License :: OSI Approved :: MIT License
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.9
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
20
|
Provides-Extra: cli
|
|
21
21
|
Requires-Dist: uuid6 (>=2023.5.2)
|
|
22
22
|
Project-URL: Repository, https://github.com/akhundMurad/typeid-python
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "typeid-python"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.2"
|
|
4
4
|
description = "Python implementation of TypeIDs: type-safe, K-sortable, and globally unique identifiers inspired by Stripe IDs"
|
|
5
5
|
authors = ["Murad Akhundov <akhundov1murad@gmail.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -9,11 +9,11 @@ repository = "https://github.com/akhundMurad/typeid-python"
|
|
|
9
9
|
classifiers = [
|
|
10
10
|
"Development Status :: 3 - Alpha",
|
|
11
11
|
"License :: OSI Approved :: MIT License",
|
|
12
|
-
"Programming Language :: Python :: 3.8",
|
|
13
12
|
"Programming Language :: Python :: 3.9",
|
|
14
13
|
"Programming Language :: Python :: 3.10",
|
|
15
14
|
"Programming Language :: Python :: 3.11",
|
|
16
15
|
"Programming Language :: Python :: 3.12",
|
|
16
|
+
"Programming Language :: Python :: 3.13",
|
|
17
17
|
"Operating System :: OS Independent",
|
|
18
18
|
]
|
|
19
19
|
keywords = ["typeid", "uuid", "uuid6", "guid"]
|
|
@@ -44,7 +44,7 @@ exclude = [
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
[tool.poetry.dependencies]
|
|
47
|
-
python = ">=3.
|
|
47
|
+
python = ">=3.9,<4"
|
|
48
48
|
uuid6 = ">=2023.5.2"
|
|
49
49
|
|
|
50
50
|
|
|
File without changes
|
|
@@ -81,13 +81,17 @@ def from_uuid(suffix: uuid6.UUID, prefix: Optional[str] = None) -> TypeID:
|
|
|
81
81
|
|
|
82
82
|
def get_prefix_and_suffix(string: str) -> tuple:
|
|
83
83
|
parts = string.rsplit("_", 1)
|
|
84
|
+
|
|
85
|
+
# When there's no underscore in the string.
|
|
84
86
|
if len(parts) == 1:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
if parts[0].strip() == "":
|
|
88
|
+
raise InvalidTypeIDStringException(f"Invalid TypeID: {string}")
|
|
89
|
+
return None, parts[0]
|
|
90
|
+
|
|
91
|
+
# When there is an underscore, unpack prefix and suffix.
|
|
92
|
+
prefix, suffix = parts
|
|
93
|
+
if prefix.strip() == "" or suffix.strip() == "":
|
|
88
94
|
raise InvalidTypeIDStringException(f"Invalid TypeID: {string}")
|
|
89
|
-
else:
|
|
90
|
-
prefix, suffix = parts
|
|
91
95
|
|
|
92
96
|
return prefix, suffix
|
|
93
97
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|