typeid-python 0.3.0__tar.gz → 0.3.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.
Potentially problematic release.
This version of typeid-python might be problematic. Click here for more details.
- {typeid_python-0.3.0 → typeid_python-0.3.1}/PKG-INFO +2 -2
- {typeid_python-0.3.0 → typeid_python-0.3.1}/pyproject.toml +2 -2
- {typeid_python-0.3.0 → typeid_python-0.3.1}/typeid/typeid.py +5 -6
- {typeid_python-0.3.0 → typeid_python-0.3.1}/LICENSE +0 -0
- {typeid_python-0.3.0 → typeid_python-0.3.1}/README.md +0 -0
- {typeid_python-0.3.0 → typeid_python-0.3.1}/typeid/__init__.py +0 -0
- {typeid_python-0.3.0 → typeid_python-0.3.1}/typeid/base32.py +0 -0
- {typeid_python-0.3.0 → typeid_python-0.3.1}/typeid/cli.py +0 -0
- {typeid_python-0.3.0 → typeid_python-0.3.1}/typeid/constants.py +0 -0
- {typeid_python-0.3.0 → typeid_python-0.3.1}/typeid/errors.py +0 -0
- {typeid_python-0.3.0 → typeid_python-0.3.1}/typeid/validation.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: typeid-python
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
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
|
|
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
20
|
Provides-Extra: cli
|
|
21
|
-
Requires-Dist: uuid6 (>=2023.5.2
|
|
21
|
+
Requires-Dist: uuid6 (>=2023.5.2)
|
|
22
22
|
Project-URL: Repository, https://github.com/akhundMurad/typeid-python
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "typeid-python"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.1"
|
|
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"
|
|
@@ -45,7 +45,7 @@ exclude = [
|
|
|
45
45
|
|
|
46
46
|
[tool.poetry.dependencies]
|
|
47
47
|
python = ">=3.8,<4"
|
|
48
|
-
uuid6 = "
|
|
48
|
+
uuid6 = ">=2023.5.2"
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
[tool.poetry.group.dev.dependencies]
|
|
@@ -80,15 +80,14 @@ def from_uuid(suffix: uuid6.UUID, prefix: Optional[str] = None) -> TypeID:
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
def get_prefix_and_suffix(string: str) -> tuple:
|
|
83
|
-
parts = string.
|
|
84
|
-
prefix = None
|
|
83
|
+
parts = string.rsplit("_", 1)
|
|
85
84
|
if len(parts) == 1:
|
|
85
|
+
prefix = None
|
|
86
86
|
suffix = parts[0]
|
|
87
|
-
elif len(parts) == 2 and parts[0]
|
|
88
|
-
suffix = parts[1]
|
|
89
|
-
prefix = parts[0]
|
|
90
|
-
else:
|
|
87
|
+
elif len(parts) == 2 and parts[0] == "":
|
|
91
88
|
raise InvalidTypeIDStringException(f"Invalid TypeID: {string}")
|
|
89
|
+
else:
|
|
90
|
+
prefix, suffix = parts
|
|
92
91
|
|
|
93
92
|
return prefix, suffix
|
|
94
93
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|