typeid-python 0.2.2__py3-none-any.whl → 0.2.3__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.
Potentially problematic release.
This version of typeid-python might be problematic. Click here for more details.
- typeid/typeid.py +16 -2
- {typeid_python-0.2.2.dist-info → typeid_python-0.2.3.dist-info}/METADATA +2 -1
- {typeid_python-0.2.2.dist-info → typeid_python-0.2.3.dist-info}/RECORD +5 -5
- {typeid_python-0.2.2.dist-info → typeid_python-0.2.3.dist-info}/WHEEL +1 -1
- {typeid_python-0.2.2.dist-info → typeid_python-0.2.3.dist-info}/LICENSE +0 -0
typeid/typeid.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import warnings
|
|
1
2
|
from typing import Optional
|
|
2
3
|
from uuid import UUID
|
|
3
4
|
|
|
@@ -47,22 +48,35 @@ class TypeID:
|
|
|
47
48
|
value += self.suffix
|
|
48
49
|
return value
|
|
49
50
|
|
|
51
|
+
def __repr__(self):
|
|
52
|
+
return "%s(%r)" % (self.__class__.__name__, str(self))
|
|
53
|
+
|
|
50
54
|
def __eq__(self, value: object) -> bool:
|
|
51
55
|
if not isinstance(value, TypeID):
|
|
52
56
|
return False
|
|
53
57
|
return value.prefix == self.prefix and value.suffix == self.suffix
|
|
54
58
|
|
|
59
|
+
def __gt__(self, other):
|
|
60
|
+
if isinstance(other, TypeID):
|
|
61
|
+
return str(self) > str(other)
|
|
62
|
+
return NotImplemented
|
|
63
|
+
|
|
64
|
+
def __ge__(self, other):
|
|
65
|
+
if isinstance(other, TypeID):
|
|
66
|
+
return str(self) >= str(other)
|
|
67
|
+
return NotImplemented
|
|
68
|
+
|
|
55
69
|
def __hash__(self) -> int:
|
|
56
70
|
return hash((self.prefix, self.suffix))
|
|
57
71
|
|
|
58
72
|
|
|
59
73
|
def from_string(string: str) -> TypeID:
|
|
60
|
-
"
|
|
74
|
+
warnings.warn("Consider TypeID.from_string instead.", DeprecationWarning)
|
|
61
75
|
return TypeID.from_string(string=string)
|
|
62
76
|
|
|
63
77
|
|
|
64
78
|
def from_uuid(suffix: UUID, prefix: Optional[str] = None) -> TypeID:
|
|
65
|
-
"
|
|
79
|
+
warnings.warn("Consider TypeID.from_uuid instead.", DeprecationWarning)
|
|
66
80
|
return TypeID.from_uuid(suffix=suffix, prefix=prefix)
|
|
67
81
|
|
|
68
82
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: typeid-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
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
|
|
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3.8
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.9
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
20
|
Provides-Extra: cli
|
|
20
21
|
Requires-Dist: uuid6 (>=2023.5.2,<2024.0.0)
|
|
21
22
|
Project-URL: Repository, https://github.com/akhundMurad/typeid-python
|
|
@@ -3,9 +3,9 @@ typeid/base32.py,sha256=UTYXJjb95_nn-vYIpw7nquguBac4GZ0TL0oE6BuujPg,6504
|
|
|
3
3
|
typeid/cli.py,sha256=h93_EAOzWO3bqubgL83Q-smHp11lvxMjgAunwyTWwFM,872
|
|
4
4
|
typeid/constants.py,sha256=2ApV0agNys2yI9NM8oQZbyTR2rgP-VtxXGrM6glBB2Q,37
|
|
5
5
|
typeid/errors.py,sha256=QPHZ-DJg5OpPOHtuetsqMCYu-E_aHMJZTTeFqx9Gz_4,207
|
|
6
|
-
typeid/typeid.py,sha256=
|
|
6
|
+
typeid/typeid.py,sha256=jGMZ3FZXSe6x8Ib6AQi5lVbmlb2PWJcwKhXDEScW_pU,2927
|
|
7
7
|
typeid/validation.py,sha256=yvLO5lfMkJpduZzql_FJlj4hW6HcWURWYLRQvR92SSM,899
|
|
8
|
-
typeid_python-0.2.
|
|
9
|
-
typeid_python-0.2.
|
|
10
|
-
typeid_python-0.2.
|
|
11
|
-
typeid_python-0.2.
|
|
8
|
+
typeid_python-0.2.3.dist-info/LICENSE,sha256=f98oZ9FId4i3835UJYGw066BU8PSc57L1utGWS1ypcs,1070
|
|
9
|
+
typeid_python-0.2.3.dist-info/METADATA,sha256=HLC7cDDSYyth-xd1bRDxNeCLPAMI2Pa6jAhz9RzHkaE,4124
|
|
10
|
+
typeid_python-0.2.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
11
|
+
typeid_python-0.2.3.dist-info/RECORD,,
|
|
File without changes
|