{"id":1775,"library":"uuid6","title":"UUID6","description":"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.","status":"active","version":"2025.0.1","language":"en","source_language":"en","source_url":"https://github.com/oittaa/uuid6-python","tags":["uuid","uuid6","uuid7","uuid8","time-based","database-key","rfc9562"],"install":[{"cmd":"pip install uuid6","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"uuid6","correct":"from uuid6 import uuid6"},{"symbol":"uuid7","correct":"from uuid6 import uuid7"},{"symbol":"uuid8","correct":"from uuid6 import uuid8"},{"symbol":"UUID","correct":"from uuid6 import UUID"},{"symbol":"uuid1_to_uuid6","correct":"from uuid6 import uuid1_to_uuid6"}],"quickstart":{"code":"from uuid6 import uuid6, uuid7, UUID\n\n# Generate a UUIDv6\nmy_uuid6 = uuid6()\nprint(f\"Generated UUIDv6: {my_uuid6}\")\nprint(f\"Type: {type(my_uuid6)}\")\n\n# Generate a UUIDv7 (millisecond granularity)\nmy_uuid7 = uuid7()\nprint(f\"Generated UUIDv7: {my_uuid7}\")\n\n# You can also instantiate UUID objects from strings\nuuid_obj = UUID(\"018e612f-8700-613d-88f5-93717d2f9d6c\")\nprint(f\"UUID object from string: {uuid_obj}\")","lang":"python","description":"Generates a UUIDv6 and UUIDv7, demonstrating basic usage and object instantiation."},"warnings":[{"fix":"Update dependency declarations to align with semantic versioning (e.g., `~=2025.0` or `>=2025.0.0,<2026.0.0`).","message":"Beginning 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.","severity":"breaking","affected_versions":"2025.0.0 and later"},{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Support 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.","severity":"breaking","affected_versions":"2023.04.25 and 2025.0.0 and later"},{"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.","message":"In 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.","severity":"breaking","affected_versions":"2022.10.25 and later"},{"fix":"Refer to the library's documentation and RFC 9562 for proper `uuid8()` implementation for custom requirements.","message":"`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.","severity":"gotcha","affected_versions":"All versions supporting `uuid8()` (from 2022.10.25)"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}