uuid-utils 0.1.0__cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl → 0.2.0__cp38-cp38-manylinux_2_5_i686.manylinux1_i686.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 uuid-utils might be problematic. Click here for more details.
- _uuid_utils/__init__.py +5 -0
- _uuid_utils/_uuid_utils.cpython-38-i386-linux-gnu.so +0 -0
- {uuid_utils-0.1.0.dist-info → uuid_utils-0.2.0.dist-info}/METADATA +26 -4
- uuid_utils-0.2.0.dist-info/RECORD +6 -0
- uuid_utils-0.2.0.dist-info/license_files/LICENSE.md +27 -0
- uuid_utils/__init__.py +0 -5
- uuid_utils/__init__.pyi +0 -113
- uuid_utils/py.typed +0 -0
- uuid_utils/uuid_utils.cpython-38-i386-linux-gnu.so +0 -0
- uuid_utils-0.1.0.dist-info/RECORD +0 -7
- {uuid_utils-0.1.0.dist-info → uuid_utils-0.2.0.dist-info}/WHEEL +0 -0
_uuid_utils/__init__.py
ADDED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: uuid_utils
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Classifier: Development Status :: 3 - Alpha
|
|
5
5
|
Classifier: Programming Language :: Python
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -11,17 +11,32 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Rust
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
License-File: LICENSE.md
|
|
14
18
|
Summary: Drop-in replacement for Python UUID in Rust
|
|
15
19
|
Keywords: rust,uuid
|
|
16
20
|
Author-email: Amin Alaee <me@aminalaee.dev>
|
|
17
21
|
Requires-Python: >=3.7
|
|
18
22
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
19
|
-
Project-URL: Source, https://github.com/aminalaee/uuid-utils
|
|
20
23
|
Project-URL: Documentation, https://github.com/aminalaee/uuid-utils
|
|
21
24
|
Project-URL: Issues, https://github.com/aminalaee/uuid-utils/issues
|
|
25
|
+
Project-URL: Source, https://github.com/aminalaee/uuid-utils
|
|
22
26
|
|
|
23
27
|
# Python UUID Utils
|
|
24
28
|
|
|
29
|
+
<p align="center">
|
|
30
|
+
<a href="https://pypi.org/project/uuid-utils/">
|
|
31
|
+
<img src="https://badge.fury.io/py/uuid-utils.svg" alt="Package version">
|
|
32
|
+
</a>
|
|
33
|
+
<a href="https://pypi.org/project/uuid-utils" target="_blank">
|
|
34
|
+
<img src="https://img.shields.io/pypi/pyversions/uuid-utils.svg?color=%2334D058" alt="Supported Python versions">
|
|
35
|
+
</a>
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
25
40
|
Python UUID implementation using Rust's UUID library.
|
|
26
41
|
This will make `uuid4` function around 10x faster.
|
|
27
42
|
|
|
@@ -39,7 +54,13 @@ Avaialble UUID versions:
|
|
|
39
54
|
- `uuid7` - Version 7 UUIDs using a Unix timestamp ordered by time.
|
|
40
55
|
- `uuid8` - Version 8 UUIDs using user-defined data.
|
|
41
56
|
|
|
42
|
-
|
|
57
|
+
<sup>Please note that UUID versions 6, 7 and 8 are still in draft RFC.</sup><br>
|
|
58
|
+
|
|
59
|
+
## Installation
|
|
60
|
+
|
|
61
|
+
```shell
|
|
62
|
+
$ pip install uuid-utils
|
|
63
|
+
```
|
|
43
64
|
|
|
44
65
|
## Example
|
|
45
66
|
|
|
@@ -77,5 +98,6 @@ UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')
|
|
|
77
98
|
## Limitations
|
|
78
99
|
|
|
79
100
|
- The `getnode` function is not available.
|
|
80
|
-
- The `uuid1` and `uuid6` take `node` argument as mandatory.
|
|
101
|
+
- The `uuid1` and `uuid6` take `node` argument as mandatory.
|
|
102
|
+
- The `uuid3` function is not available.
|
|
81
103
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
uuid_utils-0.2.0.dist-info/METADATA,sha256=pAAiPOVe3Ryf070TNqbdEyBGIEcvIjhC7Kg92p1w2Ro,3968
|
|
2
|
+
uuid_utils-0.2.0.dist-info/WHEEL,sha256=S7waJ-ZhhHJXYfhKYORuzkCzrGtHU_r4C5B0OYKpG1Q,121
|
|
3
|
+
uuid_utils-0.2.0.dist-info/license_files/LICENSE.md,sha256=DEf1K0xIS9BMeOfJaVQu6jGv5kT1h_O4qMzOhjUsYEY,1487
|
|
4
|
+
_uuid_utils/__init__.py,sha256=w2wNldnniuYCsqIRYKqT7-lH45J1dn4o16C6cM7GAP8,127
|
|
5
|
+
_uuid_utils/_uuid_utils.cpython-38-i386-linux-gnu.so,sha256=bUQ7UKRywtVmYsufJZj52O2wqEbVVjHovQniQyNdFbE,4185924
|
|
6
|
+
uuid_utils-0.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Copyright © 2023, Amin Alaee.
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
8
|
+
list of conditions and the following disclaimer.
|
|
9
|
+
|
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
|
12
|
+
and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
* Neither the name of the copyright holder nor the names of its
|
|
15
|
+
contributors may be used to endorse or promote products derived from
|
|
16
|
+
this software without specific prior written permission.
|
|
17
|
+
|
|
18
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
19
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
20
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
22
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
23
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
24
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
25
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
26
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
uuid_utils/__init__.py
DELETED
uuid_utils/__init__.pyi
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
from enum import Enum
|
|
3
|
-
|
|
4
|
-
from _typeshed import Unused
|
|
5
|
-
from typing_extensions import TypeAlias
|
|
6
|
-
|
|
7
|
-
# Because UUID has properties called int and bytes we need to rename these temporarily.
|
|
8
|
-
_Int: TypeAlias = int
|
|
9
|
-
_Bytes: TypeAlias = bytes
|
|
10
|
-
_FieldsType: TypeAlias = tuple[int, int, int, int, int, int]
|
|
11
|
-
|
|
12
|
-
class SafeUUID(Enum):
|
|
13
|
-
safe: int
|
|
14
|
-
unsafe: int
|
|
15
|
-
unknown: None
|
|
16
|
-
|
|
17
|
-
class UUID:
|
|
18
|
-
def __init__(
|
|
19
|
-
self,
|
|
20
|
-
hex: str | None = None,
|
|
21
|
-
bytes: _Bytes | None = None,
|
|
22
|
-
bytes_le: _Bytes | None = None,
|
|
23
|
-
fields: _FieldsType | None = None,
|
|
24
|
-
int: _Int | None = None,
|
|
25
|
-
version: _Int | None = None,
|
|
26
|
-
*,
|
|
27
|
-
is_safe: SafeUUID = ...,
|
|
28
|
-
) -> None: ...
|
|
29
|
-
@property
|
|
30
|
-
def is_safe(self) -> SafeUUID: ...
|
|
31
|
-
@property
|
|
32
|
-
def bytes(self) -> _Bytes: ...
|
|
33
|
-
@property
|
|
34
|
-
def bytes_le(self) -> _Bytes: ...
|
|
35
|
-
@property
|
|
36
|
-
def clock_seq(self) -> _Int: ...
|
|
37
|
-
@property
|
|
38
|
-
def clock_seq_hi_variant(self) -> _Int: ...
|
|
39
|
-
@property
|
|
40
|
-
def clock_seq_low(self) -> _Int: ...
|
|
41
|
-
@property
|
|
42
|
-
def fields(self) -> _FieldsType: ...
|
|
43
|
-
@property
|
|
44
|
-
def hex(self) -> str: ...
|
|
45
|
-
@property
|
|
46
|
-
def int(self) -> _Int: ...
|
|
47
|
-
@property
|
|
48
|
-
def node(self) -> _Int: ...
|
|
49
|
-
@property
|
|
50
|
-
def time(self) -> _Int: ...
|
|
51
|
-
@property
|
|
52
|
-
def time_hi_version(self) -> _Int: ...
|
|
53
|
-
@property
|
|
54
|
-
def time_low(self) -> _Int: ...
|
|
55
|
-
@property
|
|
56
|
-
def time_mid(self) -> _Int: ...
|
|
57
|
-
@property
|
|
58
|
-
def urn(self) -> str: ...
|
|
59
|
-
@property
|
|
60
|
-
def variant(self) -> str: ...
|
|
61
|
-
@property
|
|
62
|
-
def version(self) -> _Int | None: ...
|
|
63
|
-
def __int__(self) -> _Int: ...
|
|
64
|
-
def __eq__(self, other: object) -> bool: ...
|
|
65
|
-
def __lt__(self, other: UUID) -> bool: ...
|
|
66
|
-
def __le__(self, other: UUID) -> bool: ...
|
|
67
|
-
def __gt__(self, other: UUID) -> bool: ...
|
|
68
|
-
def __ge__(self, other: UUID) -> bool: ...
|
|
69
|
-
|
|
70
|
-
if sys.version_info >= (3, 9):
|
|
71
|
-
def getnode() -> int: ...
|
|
72
|
-
|
|
73
|
-
else:
|
|
74
|
-
def getnode(*, getters: Unused = None) -> int: ... # undocumented
|
|
75
|
-
|
|
76
|
-
def uuid1(node: _Int, clock_seq: _Int | None = None) -> UUID:
|
|
77
|
-
"""Generate a UUID from a host ID, sequence number, and the current time.
|
|
78
|
-
If 'node' is not given, getnode() is used to obtain the hardware
|
|
79
|
-
address. If 'clock_seq' is given, it is used as the sequence number;
|
|
80
|
-
otherwise a random 14-bit sequence number is chosen."""
|
|
81
|
-
...
|
|
82
|
-
|
|
83
|
-
def uuid3(namespace: UUID, name: str) -> UUID:
|
|
84
|
-
"""Generate a UUID from the MD5 hash of a namespace UUID and a name."""
|
|
85
|
-
...
|
|
86
|
-
|
|
87
|
-
def uuid4() -> UUID:
|
|
88
|
-
"""Generate a random UUID."""
|
|
89
|
-
...
|
|
90
|
-
|
|
91
|
-
def uuid5(namespace: UUID, name: str) -> UUID:
|
|
92
|
-
"""Generate a UUID from the SHA-1 hash of a namespace UUID and a name."""
|
|
93
|
-
...
|
|
94
|
-
|
|
95
|
-
def uuid6(node: _Int, timestamp: _Int | None = None) -> UUID:
|
|
96
|
-
"""Generate a version 6 UUID using the given timestamp and a host ID.
|
|
97
|
-
This is similar to version 1 UUIDs,
|
|
98
|
-
except that it is lexicographically sortable by timestamp.
|
|
99
|
-
"""
|
|
100
|
-
...
|
|
101
|
-
|
|
102
|
-
def uuid7(timestamp: _Int | None = None) -> UUID:
|
|
103
|
-
"""Generate a version 7 UUID using a time value and random bytes."""
|
|
104
|
-
...
|
|
105
|
-
|
|
106
|
-
def uuid8(bytes: _Bytes) -> UUID:
|
|
107
|
-
"""Generate a custom UUID comprised almost entirely of user-supplied bytes.."""
|
|
108
|
-
...
|
|
109
|
-
|
|
110
|
-
NAMESPACE_DNS: UUID
|
|
111
|
-
NAMESPACE_URL: UUID
|
|
112
|
-
NAMESPACE_OID: UUID
|
|
113
|
-
NAMESPACE_X500: UUID
|
uuid_utils/py.typed
DELETED
|
File without changes
|
|
Binary file
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
uuid_utils-0.1.0.dist-info/METADATA,sha256=0S1DfTLoP3rLm-DN5S5PlXY1lEu7pN70pC_HT4URArE,3347
|
|
2
|
-
uuid_utils-0.1.0.dist-info/WHEEL,sha256=S7waJ-ZhhHJXYfhKYORuzkCzrGtHU_r4C5B0OYKpG1Q,121
|
|
3
|
-
uuid_utils/__init__.py,sha256=1Jjzg5fls_hydfWqGqhdXJ5McRzHx37jWXWLZKiJly0,123
|
|
4
|
-
uuid_utils/__init__.pyi,sha256=nebrJQDComytFSERifWKXseGuhz80wiSm7dETVVadW4,3256
|
|
5
|
-
uuid_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
uuid_utils/uuid_utils.cpython-38-i386-linux-gnu.so,sha256=5APA2aDJOD5FRksvqnceCxoggkD3MeFhDjFJuoH-nUQ,4163788
|
|
7
|
-
uuid_utils-0.1.0.dist-info/RECORD,,
|
|
File without changes
|