UUID version 7 (Pre-RFC Standard)
This library implements UUID version 7 based on an *earlier draft* of the specification, offering time-sorted UUIDs with approximately 50ns resolution. Released at version 0.1.0 in late 2021, it appears to be unmaintained. Crucially, it **does NOT conform to the final RFC 9562 standard for UUIDv7**, which specifies millisecond precision, leading to significant compatibility issues with compliant implementations.
Warnings
- breaking This library implements an **outdated draft** of the UUIDv7 specification. It uses nanosecond (or ~50ns) time precision, whereas the final RFC 9562 standard specifies millisecond precision. UUIDs generated by this library are not compatible or correctly sortable with UUIDs from RFC 9562 compliant implementations (e.g., Python 3.14's `uuid.uuid7` or the `uuid-extension` PyPI package). Migrating to a compliant implementation will result in non-monotonic UUIDs if mixed with those from this package.
- deprecated The `uuid7` package appears to be unmaintained, with its last release (0.1.0) in December 2021. This indicates it will not be updated to conform to the final RFC 9562 specification or receive further bug fixes.
- gotcha The documentation on this package's PyPI page is misleading, often showing import examples for a *different* package (`uuid_extensions`). This can lead to confusion and incorrect installations or import paths.
- gotcha Python 3.14 and later versions will include a built-in `uuid.uuid7()` function that is fully compliant with RFC 9562. Using this `uuid7` (pypi slug) package will conflict with future standard library behavior and lead to non-compliant UUIDs.
Install
-
pip install uuid7
Imports
- uuid7
from uuid7 import uuid7
Quickstart
from uuid7 import uuid7
# Generate a new non-RFC 9562 compliant UUIDv7
my_uuid = uuid7()
print(f"Generated UUID: {my_uuid}")
print(f"UUID as string: {str(my_uuid)}")
print(f"UUID as integer: {my_uuid.int}")