--- id: uuid7 version: "0.1.0" license: MIT license license_treatment: permissive maintenance: dormant --- # uuid7 — UUID version 7, generating time-sorted UUIDs with 200ns time resolution and 48 bits of randomness License: permissive · Maintenance: dormant · Downloads: 14.6M/mo ## What it is and what it does uuid7 implements version 7 UUIDs as proposed in draft-peabody-dispatch-new-uuid-format-02, which encode a Unix timestamp in the first 36 bits followed by fractional seconds, a sequential counter, and random bits. Unlike standard UUIDs, version 7 UUIDs sort chronologically by their creation time, making them useful for databases and systems where insertion order matters. The package provides multiple output formats (bytes, hex, int, str, uuid, or None). The implementation allocates the 128 bits as: 36 bits of whole seconds since epoch, 24 bits of fractional seconds (approximately 50ns resolution), 14 bits of sequential counter for repeated calls within the same time tick, and 48 bits of randomness, plus RFC4122-mandated version and variant bits. Generation is faster than uuid.uuid4() when returning integers or strings, though slightly slower when returning UUID objects. Use it for: - Database primary keys where insertion order and time-based sorting are both required without a separate timestamp column. - Distributed system event IDs that need to be both globally unique and chronologically orderable across nodes. - Time-series data collection where UUID generation order reflects actual event timing. - Log entry identifiers that can be sorted by creation time without parsing metadata. - Microservice request tracing where trace IDs encode their generation timestamp for quick temporal analysis. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates version 7 UUIDs that are time-sortable with chronological ordering and include randomness for uniqueness. Yes, if you need time-sortable UUIDs and can accept a dormant package (no updates since 2021-12-29). The implementation is simple, dependency-free, and MIT-licensed. However, verify that RFC4122 version 7 adoption aligns with your infrastructure's UUID support before committing to it as a primary identifier scheme. ## Install pip install uuid7 uv add uuid7 poetry add uuid7 ## Installing uuid7 Before you install: No runtime dependencies and a pure-Python wheel distribution make installation straightforward. The package is dormant (last release 2021-12-29, last commit 2025-02-10) but the repository remains active and unarchived. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects. Quickstart: pip install uuid7 from uuid7 import uuid7 # Generate a time-sortable UUID my_uuid = uuid7() print(my_uuid) # UUID('061cb26a-54b8-7a52-8000-2124e7041024') Verify before relying: - Whether the 50ns time resolution claim and the 200ns resolution in the summary are equivalent or represent different measurement contexts. - Current adoption rate and real-world production use beyond the top-5000 download tier. - Whether draft-peabody-dispatch-new-uuid-format-02 has progressed to RFC status since the package's 2021 release. - Import path: whether uuid7() is imported directly from uuid7 or from a submodule. ## Package facts - License: MIT license (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 14.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags time-sortable UUID generation, uuid v7 implementation, chronological UUID, sortable unique identifiers, timestamp-based UUID, uuid7 library, RFC4122 extension UUID, uuid-generation, time-sortable, distributed-systems [View on SkillFed](https://skillfed.io/packages/uuid7) · [View on PyPI](https://pypi.org/project/uuid7/)