Fast, drop-in replacement for Python's uuid module, powered by Rust.
Project Links
Meta
Author: Amin Alaee
Requires Python: >=3.9
Classifiers
Development Status
- 5 - Production/Stable
Programming Language
- Python
- Python :: 3
- Python :: 3 :: Only
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
- Python :: 3.14
- Rust
Intended Audience
- Developers
Operating System
- OS Independent
Python UUID Utils
Fast, drop-in replacement for Python's uuid module, powered by Rust.
Available UUID versions:
uuid1- Version 1 UUIDs using a timestamp and monotonic counter.uuid3- Version 3 UUIDs based on the MD5 hash of some data.uuid4- Version 4 UUIDs with random data.uuid5- Version 5 UUIDs based on the SHA1 hash of some data.uuid6- Version 6 UUIDs using a timestamp and monotonic counter.uuid7- Version 7 UUIDs using a Unix timestamp ordered by time.uuid8- Version 8 UUIDs using user-defined data.
Installation
Using pip:
$ pip install uuid-utils
or, using conda:
$ conda install -c conda-forge uuid-utils
Example
>>> import uuid_utils as uuid
>>> # make a random UUID
>>> uuid.uuid4()
UUID('ffe95fcc-b818-4aca-a350-e0a35b9de6ec')
>>> # make a random UUID using a Unix timestamp which is time-ordered.
>>> uuid.uuid7()
UUID('018afa4a-0d21-7e6c-b857-012bc678552b')
>>> # make a UUID using a SHA-1 hash of a namespace UUID and a name
>>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')
UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')
>>> # make a UUID using an MD5 hash of a namespace UUID and a name
>>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')
Compatibility with Python UUID
In some cases, for example if you are using Django, you might need UUID instances to be returned
from the standard-library uuid, not a custom UUID class.
In that case you can use the uuid_utils.compat which comes with a performance penalty
in comparison with the uuid_utils default behaviour, but is still faster than the standard-library.
>>> import uuid_utils.compat as uuid
>>> # make a random UUID
>>> uuid.uuid4()
UUID('ffe95fcc-b818-4aca-a350-e0a35b9de6ec')
Benchmarks
| Benchmark | Min | Max | Mean | Min (+) | Max (+) | Mean (+) |
|---|---|---|---|---|---|---|
| UUID v1 | 0.061 | 0.299 | 0.194 | 0.019 (3.3x) | 0.019 (15.4x) | 0.019 (10.1x) |
| UUID v3 | 0.267 | 0.307 | 0.293 | 0.035 (7.6x) | 0.041 (7.5x) | 0.039 (7.5x) |
| UUID v4 | 0.073 | 0.119 | 0.083 | 0.005 (15.2x) | 0.005 (24.6x) | 0.005 (17.1x) |
| UUID v5 | 0.058 | 0.189 | 0.146 | 0.008 (7.6x) | 0.038 (5.0x) | 0.016 (9.0x) |
| UUID v6 | 0.032 | 0.033 | 0.032 | 0.003 (10.1x) | 0.003 (10.3x) | 0.003 (10.1x) |
| UUID v7 | 0.063 | 0.063 | 0.063 | 0.004 (16.1x) | 0.004 (16.0x) | 0.004 (16.1x) |
| UUID from hex | 0.128 | 0.139 | 0.135 | 0.016 (8.2x) | 0.017 (8.0x) | 0.016 (8.3x) |
| UUID from bytes | 0.031 | 0.135 | 0.093 | 0.016 (2.0x) | 0.016 (8.6x) | 0.016 (5.9x) |
| UUID from int | 0.027 | 0.102 | 0.043 | 0.003 (8.3x) | 0.004 (25.0x) | 0.003 (12.4x) |
| UUID from fields | 0.031 | 0.162 | 0.077 | 0.005 (6.0x) | 0.005 (30.6x) | 0.005 (14.7x) |
Benchmark results might vary in different environments, but in most cases the uuid_utils should outperform stdlib uuid.
How to develop locally
$ make build
$ make test
Or:
$ maturin develop --release
0.14.1
Feb 20, 2026
0.14.0
Jan 20, 2026
0.13.0
Jan 08, 2026
0.12.0
Dec 01, 2025
0.11.1
Oct 02, 2025
0.11.0
May 22, 2025
0.10.0
Nov 21, 2024
0.9.0
Jun 28, 2024
0.8.0
Jun 17, 2024
0.7.0
May 03, 2024
0.6.1
Nov 06, 2023
0.6.0
Nov 03, 2023
0.5.0
Oct 05, 2023
0.4.0
Oct 03, 2023
0.3.0
Apr 01, 2023
0.2.0
Mar 29, 2023
0.1.0
Mar 26, 2023
0.0.0
Mar 25, 2023
Wheel compatibility matrix
Files in release
uuid_utils-0.14.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (590.5KiB)
uuid_utils-0.14.1-cp39-abi3-macosx_10_12_x86_64.whl (302.1KiB)
uuid_utils-0.14.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (336.6KiB)
uuid_utils-0.14.1-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (342.7KiB)
uuid_utils-0.14.1-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (471.3KiB)
uuid_utils-0.14.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (337.6KiB)
uuid_utils-0.14.1-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl (363.5KiB)
uuid_utils-0.14.1-cp39-abi3-musllinux_1_2_aarch64.whl (509.6KiB)
uuid_utils-0.14.1-cp39-abi3-musllinux_1_2_armv7l.whl (610.6KiB)
uuid_utils-0.14.1-cp39-abi3-musllinux_1_2_i686.whl (574.0KiB)
uuid_utils-0.14.1-cp39-abi3-musllinux_1_2_x86_64.whl (538.5KiB)
uuid_utils-0.14.1-cp39-abi3-win32.whl (179.2KiB)
uuid_utils-0.14.1-cp39-abi3-win_amd64.whl (182.8KiB)
uuid_utils-0.14.1-cp39-abi3-win_arm64.whl (183.7KiB)
uuid_utils-0.14.1-pp311-pypy311_pp73-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (577.8KiB)
uuid_utils-0.14.1-pp311-pypy311_pp73-macosx_10_12_x86_64.whl (296.6KiB)
uuid_utils-0.14.1-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (329.8KiB)
uuid_utils-0.14.1-pp311-pypy311_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (335.7KiB)
uuid_utils-0.14.1-pp311-pypy311_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (465.6KiB)
uuid_utils-0.14.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (331.0KiB)
uuid_utils-0.14.1-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl (356.2KiB)
uuid_utils-0.14.1.tar.gz (21.7KiB)
No dependencies