The Wayback Machine - https://web.archive.org/web/20260304161221/https://github.com/python/cpython/issues/121095
Skip to content

Built-in function for generating UUIDv7 identifiers according to RFC9562 #121095

@sergeyprokhorenko

Description

@sergeyprokhorenko

Feature or enhancement

Proposal:

A long awaited new RFC 9562 "Universally Unique IDentifiers (UUIDs)" has been recently published. There is a pressing need to implement UUIDv7 with Fixed Bit-Length Dedicated Counter (Method 1) for Python for use as database keys.

The best choice is to take uuid-rs/uuid#717 (it is perfect) as an example and add to it an optional formal parameter "timestamp offset" in milliseconds (positive or negative). Another good example: UUID v7

See also https://kodraus.github.io/rust/2024/06/24/uuid-v7-counters.html and https://www.reddit.com/r/rust/comments/1dn5ge4/uuid_now_properly_sorts_v7_ids/

Example of an existing implementation: quwac/newnewid-python

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

RFC 4122/9562: UUID version 7 and 8 implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions