{"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":"python","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,"search_vec":"'2025.0.0':35 'base':9,59 'better':24 'cadenc':52 'calendar':40 'databas':21,61 'database-key':60 'format':11 'frequent':50 'key':22,62 'librari':4 'maintain':48 'major.minor.patch':46 'new':6 'offer':23 'optim':17 'order':28 'perform':25 'project':37 'provid':5 'releas':51 'rfc9562':63 'semant':44 'sequenti':27 'time':8,58 'time-bas':7,57 'tradit':30 'transit':38 'use':19 'uuid':10,53 'uuid6':1,3,54 'uuid7':55 'uuid8':56 'uuidv1':31 'v6':12 'v7':13 'v8':14 'version':34,41,45 'yyyy.mm.dd':42","created_at":"2026-04-09T04:02:35.746885+00:00","updated_at":"2026-04-17T00:05:23.384460+00:00","problems":[{"fix":"pip install uuid6","cause":"The 'uuid6' library has not been installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'uuid6'"},{"fix":"Install the `uuid6` library and import its functions directly: `import uuid6` and then call `uuid6.uuid6()`.","cause":"You are attempting to use the `uuid6()` function from Python's standard `uuid` module, which does not provide UUIDv6, v7, or v8 generation.","error":"AttributeError: module 'uuid' has no attribute 'uuid6'"},{"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()`.","cause":"The `uuid6.uuid6()` function, for simple UUIDv6 generation, does not accept any arguments by default.","error":"TypeError: uuid6() takes 0 positional arguments but 1 was given"},{"fix":"Import the specific UUID generation function you need, for example: `from uuid6 import uuid6`.","cause":"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.","error":"ImportError: cannot import name 'uuid' from 'uuid6'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2025.0.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/oittaa/uuid6-python","docs":null,"changelog":null,"pypi":"https://pypi.org/project/uuid6/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-27","next_check":"2026-07-28","install_tag":null}}