Registry / serialization / uuid7-standard

uuid7-standard

JSON →
library1.1.0pypypi✓ verified 84d ago

This library provides a Python implementation for generating and manipulating UUIDs adhering to the final UUID version 7 standard, ensuring time-ordered identifiers. It explicitly distinguishes itself from the older `uuid7` package on PyPI, which was based on an earlier draft of the standard. The current version is 1.1.0, and it follows a release cadence driven by bug fixes and minor improvements.

pip install uuid7-standard
INSTALL
IMPORT
SIG · UUID7-STANDARD
U
uuid7-standard
serializationpythonv1.1.0
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.0 · 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.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

UUID
from uuid7 import UUID
from uuid7_standard import generate_uuid
create
from uuid7 import create
from uuid7_standard import generate_uuid
datetime
from uuid7 import datetime
from uuid7_standard import generate_uuid

This quickstart demonstrates how to generate a new UUIDv7 using `generate_uuid()` and how to parse an existing UUIDv7 string back into a `UUID7` object.

from uuid7_standard import generate_uuid, UUID7 # Generate a UUIDv7 object new_uuid = generate_uuid() print(f"Generated UUIDv7 object: {new_uuid}") print(f"Type: {type(new_uuid)}") print(f"UUIDv7 as string: {str(new_uuid)}") # You can also parse a UUIDv7 string into a UUID7 object # Example valid UUIDv7 string (replace with your actual UUID if needed) uuid_str = str(new_uuid) # Or use a known valid UUIDv7 string try: parsed_uuid = UUID7(uuid_str) print(f"Parsed UUIDv7 object: {parsed_uuid}") print(f"Timestamp of parsed UUID: {parsed_uuid.datetime}") except ValueError as e: print(f"Error parsing UUID: {e}")
Debug
Known issues
gotchaThere is a significant potential for confusion with the `uuid7` package on PyPI. The `uuid7` package implements an older draft of the UUIDv7 standard, which is different from the final standard implemented by `uuid7-standard`.
fix
Always explicitly install `pip install uuid7-standard` and import from `uuid7_standard` (e.g., `from uuid7_standard import generate_uuid`) to ensure you are using the final standard's implementation. Do not use `import uuid7` if you intend to use this library.
affects: All versions
gotchaThe `generate_uuid()` function returns a `UUID7` object, which provides methods for accessing its components (like `datetime`). It does not directly return a string. If a string representation is immediately needed, explicit conversion is required.
fix
To obtain the UUID string, explicitly cast the `UUID7` object to `str()` (e.g., `str(generate_uuid())`) or use its `.hex` attribute (e.g., `generate_uuid().hex`).
affects: All versions
Upgrade
Version history
1.1.0latest on PyPI · released Jul 4, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
uuid7-standard — pip install uuid7-standard · libregistry