Registry / serialization / uuid6
library2025.0.1pypypi✓ verified 29d ago

The uuid6 library provides new time-based UUID formats (v6, v7, v8) that are optimized for use as database keys, offering better performance and sequential ordering than traditional UUIDv1. As of version 2025.0.0, the project transitioned from Calendar Versioning (YYYY.MM.DD) to Semantic Versioning (MAJOR.MINOR.PATCH) and maintains a frequent release cadence.

pip install uuid6
INSTALL
IMPORT
SIG · UUID6
U
uuid6
serializationpythonv2025.0.1
Install
1.5s avg
Import
116ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2025.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.122s · 17.8MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.110s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

uuid6
✓ from uuid6 import uuid6
uuid7
✓ from uuid6 import uuid7
uuid8
✓ from uuid6 import uuid8
UUID
✓ from uuid6 import UUID
uuid1_to_uuid6
✓ from uuid6 import uuid1_to_uuid6

Generates a UUIDv6 and UUIDv7, demonstrating basic usage and object instantiation.

from uuid6 import uuid6, uuid7, UUID # Generate a UUIDv6 my_uuid6 = uuid6() print(f"Generated UUIDv6: {my_uuid6}") print(f"Type: {type(my_uuid6)}") # Generate a UUIDv7 (millisecond granularity) my_uuid7 = uuid7() print(f"Generated UUIDv7: {my_uuid7}") # You can also instantiate UUID objects from strings uuid_obj = UUID("018e612f-8700-613d-88f5-93717d2f9d6c") print(f"UUID object from string: {uuid_obj}")
Debug
Known issues
breakingBeginning with version 2025.0.0, the project transitioned from Calendar Versioning (YYYY.MM.DD) to Semantic Versioning (MAJOR.MINOR.PATCH). This impacts how future versions are declared and may require adjustments in dependency pinning strategies.
fix
Update dependency declarations to align with semantic versioning (e.g., `~=2025.0` or `>=2025.0.0,<2026.0.0`).
affects: 2025.0.0 and later
breakingSupport for Python 3.8 was dropped in version 2025.0.0. Earlier, Python 3.7 support was removed in 2023.04.25. The library now requires Python 3.9 or newer.
fix
Upgrade your Python environment to 3.9 or newer.
affects: 2023.04.25 and 2025.0.0 and later
breakingIn version 2022.10.25, the internal timestamp granularity for `uuid7()` was changed from nanoseconds to milliseconds, aligning with Draft 00 of the RFC. This significantly alters the uniqueness characteristics and ordering guarantees if you were relying on nanosecond precision.
fix
If nanosecond granularity or previous `uuid7()` behavior is required, consider implementing a custom UUIDv8 scheme or using alternative methods. The current `uuid7()` is suitable for most database key use cases.
affects: 2022.10.25 and later
gotcha`uuid8()` is provided for custom, user-defined UUIDs as per RFC 9562, often requiring specific byte sequences or fields. It's not a direct drop-in replacement for the older nanosecond-granularity `uuid7()` behavior and requires careful implementation for specific use cases.
fix
Refer to the library's documentation and RFC 9562 for proper `uuid8()` implementation for custom requirements.
affects: All versions supporting `uuid8()` (from 2022.10.25)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'uuid6'
The 'uuid6' library has not been installed in the current Python environment.
fix
pip install uuid6
AttributeError: module 'uuid' has no attribute 'uuid6'
You are attempting to use the `uuid6()` function from Python's standard `uuid` module, which does not provide UUIDv6, v7, or v8 generation.
fix
Install the `uuid6` library and import its functions directly: `import uuid6` and then call `uuid6.uuid6()`.
TypeError: uuid6() takes 0 positional arguments but 1 was given
The `uuid6.uuid6()` function, for simple UUIDv6 generation, does not accept any arguments by default.
fix
Call `uuid6.uuid6()` without any arguments. If you intend to specify a timestamp or other parameters, use specific functions like `uuid6.uuid6_from_timestamp()`.
ImportError: cannot import name 'uuid' from 'uuid6'
You are attempting to import a generic 'uuid' object from the `uuid6` library, but `uuid6` exports its specific generation functions (e.g., `uuid6`, `uuid7`) directly.
fix
Import the specific UUID generation function you need, for example: `from uuid6 import uuid6`.
Upgrade
Version history
2025.0.1latest on PyPI · released Jul 4, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
33 hits · last 30 days
node
28
OpenAI (training)
1
Resources
uuid6 — pip install uuid6 · libregistry