uuid-utils 0.6.1__cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl → 0.7.0__cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.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__.pyi CHANGED
@@ -112,6 +112,7 @@ class UUID:
112
112
  """Get UUID timestamp milliseconds since epoch.
113
113
  Only works for UUID versions 1, 6 and 7, otherwise raises ValueError."""
114
114
  ...
115
+
115
116
  @property
116
117
  def urn(self) -> str: ...
117
118
  @property
@@ -1,31 +1,62 @@
1
- import uuid
1
+ from uuid import (
2
+ NAMESPACE_DNS,
3
+ NAMESPACE_OID,
4
+ NAMESPACE_URL,
5
+ NAMESPACE_X500,
6
+ RESERVED_FUTURE,
7
+ RESERVED_MICROSOFT,
8
+ RESERVED_NCS,
9
+ RFC_4122,
10
+ UUID,
11
+ getnode,
12
+ )
2
13
 
3
14
  import uuid_utils
4
15
 
16
+ __all__ = [
17
+ "NAMESPACE_DNS",
18
+ "NAMESPACE_OID",
19
+ "NAMESPACE_URL",
20
+ "NAMESPACE_X500",
21
+ "RESERVED_FUTURE",
22
+ "RESERVED_MICROSOFT",
23
+ "RESERVED_NCS",
24
+ "RFC_4122",
25
+ "UUID",
26
+ "getnode",
27
+ "uuid1",
28
+ "uuid3",
29
+ "uuid4",
30
+ "uuid5",
31
+ "uuid6",
32
+ "uuid7",
33
+ "uuid8",
34
+ ]
35
+
5
36
 
6
37
  def uuid1(node=None, clock_seq=None):
7
38
  """Generate a UUID from a host ID, sequence number, and the current time.
8
39
  If 'node' is not given, getnode() is used to obtain the hardware
9
40
  address. If 'clock_seq' is given, it is used as the sequence number;
10
41
  otherwise a random 14-bit sequence number is chosen."""
11
- return uuid.UUID(int=uuid_utils.uuid1(node, clock_seq).int)
42
+ return UUID(int=uuid_utils.uuid1(node, clock_seq).int)
12
43
 
13
44
 
14
45
  def uuid3(namespace, name):
15
46
  """Generate a UUID from the MD5 hash of a namespace UUID and a name."""
16
47
  namespace = uuid_utils.UUID(namespace.hex) if namespace else namespace
17
- return uuid.UUID(int=uuid_utils.uuid3(namespace, name).int)
48
+ return UUID(int=uuid_utils.uuid3(namespace, name).int)
18
49
 
19
50
 
20
51
  def uuid4():
21
52
  """Generate a random UUID."""
22
- return uuid.UUID(int=uuid_utils.uuid4().int)
53
+ return UUID(int=uuid_utils.uuid4().int)
23
54
 
24
55
 
25
56
  def uuid5(namespace, name):
26
57
  """Generate a UUID from the SHA-1 hash of a namespace UUID and a name."""
27
58
  namespace = uuid_utils.UUID(namespace.hex) if namespace else namespace
28
- return uuid.UUID(int=uuid_utils.uuid5(namespace, name).int)
59
+ return UUID(int=uuid_utils.uuid5(namespace, name).int)
29
60
 
30
61
 
31
62
  def uuid6(node=None, timestamp=None):
@@ -33,14 +64,14 @@ def uuid6(node=None, timestamp=None):
33
64
  This is similar to version 1 UUIDs,
34
65
  except that it is lexicographically sortable by timestamp.
35
66
  """
36
- return uuid.UUID(int=uuid_utils.uuid6(node, timestamp).int)
67
+ return UUID(int=uuid_utils.uuid6(node, timestamp).int)
37
68
 
38
69
 
39
70
  def uuid7(timestamp=None):
40
71
  """Generate a version 7 UUID using a time value and random bytes."""
41
- return uuid.UUID(int=uuid_utils.uuid7(timestamp).int)
72
+ return UUID(int=uuid_utils.uuid7(timestamp).int)
42
73
 
43
74
 
44
75
  def uuid8(bytes):
45
76
  """Generate a custom UUID comprised almost entirely of user-supplied bytes.."""
46
- return uuid.UUID(bytes=uuid_utils.uuid8(bytes).bytes)
77
+ return UUID(bytes=uuid_utils.uuid8(bytes).bytes)
@@ -1,11 +1,10 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: uuid_utils
3
- Version: 0.6.1
3
+ Version: 0.7.0
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Programming Language :: Python
6
6
  Classifier: Programming Language :: Python :: 3
7
7
  Classifier: Programming Language :: Python :: 3 :: Only
8
- Classifier: Programming Language :: Python :: 3.7
9
8
  Classifier: Programming Language :: Python :: 3.8
10
9
  Classifier: Programming Language :: Python :: 3.9
11
10
  Classifier: Programming Language :: Python :: 3.10
@@ -19,7 +18,7 @@ License-File: LICENSE.md
19
18
  Summary: Drop-in replacement for Python UUID in Rust
20
19
  Keywords: rust,uuid
21
20
  Author-email: Amin Alaee <me@aminalaee.dev>
22
- Requires-Python: >=3.7
21
+ Requires-Python: >=3.8
23
22
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
24
23
  Project-URL: Documentation, https://github.com/aminalaee/uuid-utils
25
24
  Project-URL: Issues, https://github.com/aminalaee/uuid-utils/issues
@@ -85,6 +84,21 @@ UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')
85
84
  UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')
86
85
  ```
87
86
 
87
+ ## Compat module
88
+
89
+ In some cases you might need `UUID` instances to be returned
90
+ from the standrad-library `uuid`, not a custom `UUID` class.
91
+ In that case you can use the `uuid_utils.compat` which comes with a performance penalty
92
+ in comparison with the `uuid_utils` default behaviour, but still faster than the standard-library.
93
+
94
+ ```py
95
+ >>> import uuid_utils.compat as uuid
96
+
97
+ >>> # make a random UUID
98
+ >>> uuid.uuid4()
99
+ UUID('ffe95fcc-b818-4aca-a350-e0a35b9de6ec')
100
+ ```
101
+
88
102
  ## Benchmarks
89
103
 
90
104
  | Benchmark | Min | Max | Mean | Min (+) | Max (+) | Mean (+) |
@@ -0,0 +1,10 @@
1
+ uuid_utils-0.7.0.dist-info/METADATA,sha256=XpVI7UmfHTsaPEOz1jRzrKQs_8jnpcz8o6G0mRjX3h8,4625
2
+ uuid_utils-0.7.0.dist-info/WHEEL,sha256=bvSsOm5DGRpvPHK7VUpAmj4Xf9S6gp455HrN2MHl1A8,127
3
+ uuid_utils-0.7.0.dist-info/license_files/LICENSE.md,sha256=DEf1K0xIS9BMeOfJaVQu6jGv5kT1h_O4qMzOhjUsYEY,1487
4
+ uuid_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ uuid_utils/__init__.py,sha256=teEvYB7oh34wISOjZYdA011-7VdeLKfQGjR615_-lCc,622
6
+ uuid_utils/__init__.pyi,sha256=JNQmgdNecusC7zFZiZTosO9d08yGm3sOCITC6PHF2P4,6058
7
+ uuid_utils/compat/__init__.py,sha256=-pGwZJmEoRzNmqteXXtcbjzO7KO3-xekYT02GjImtmM,2071
8
+ uuid_utils/compat/__init__.pyi,sha256=msxBDRkxWjdSRFmCeP2O2J6pib2qkJoZEaoC5hcF8X8,1425
9
+ uuid_utils/_uuid_utils.cpython-38-arm-linux-gnueabihf.so,sha256=aydlshsJ7vfsIG-3yFc6BoexOZCBTKejEgvzsj5NjxI,3815632
10
+ uuid_utils-0.7.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: maturin (1.3.1)
2
+ Generator: maturin (1.5.1)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l
@@ -1,10 +0,0 @@
1
- uuid_utils-0.6.1.dist-info/METADATA,sha256=n2cRIvPyh16fFb-4OMW4g-FRdXcVcV1kwuf-cCFeXNQ,4211
2
- uuid_utils-0.6.1.dist-info/WHEEL,sha256=XVbAHT85wCWFrifFZ4OEY-Msb8aEOa_lb4QsDBO5CXQ,127
3
- uuid_utils-0.6.1.dist-info/license_files/LICENSE.md,sha256=DEf1K0xIS9BMeOfJaVQu6jGv5kT1h_O4qMzOhjUsYEY,1487
4
- uuid_utils/compat/__init__.pyi,sha256=msxBDRkxWjdSRFmCeP2O2J6pib2qkJoZEaoC5hcF8X8,1425
5
- uuid_utils/compat/__init__.py,sha256=ajFZzOqIG4NPov3MOxyX3RoZeORisTJqn6X1H0PWGRY,1617
6
- uuid_utils/__init__.pyi,sha256=Nyd0LDQeqTqOKkjU4358YbDFbxrqwpPb9hP6aQioVCg,6057
7
- uuid_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- uuid_utils/__init__.py,sha256=teEvYB7oh34wISOjZYdA011-7VdeLKfQGjR615_-lCc,622
9
- uuid_utils/_uuid_utils.cpython-38-arm-linux-gnueabihf.so,sha256=WCjARZvPT8BojZ_4kkeTm2rA-ZC6hWMXviqBwdhjHao,4696524
10
- uuid_utils-0.6.1.dist-info/RECORD,,