pydantic / pydantic-extra-types

Extra Pydantic types.
MIT License
181 stars 48 forks source link

UUID v7 Support #204

Open chrisgoddard opened 3 weeks ago

chrisgoddard commented 3 weeks ago

Initial Checks

Description

UUIDv7 is becoming much more widely utilized in a variety of applications due to it's embedded timestamp and lexicographical sorting. It would be great to have that version supported by the Pydantic UUID field type.

Affected Components

sydney-runkle commented 3 weeks ago

Sounds great, PRs welcome!

Vasanth-96 commented 3 weeks ago

Sounds great, PRs welcome!

Hi @sydney-runkle Just a heads up—the default uuid package currently doesn't support UUIDv7. We'll need to use a uuid_utils package and add it separately.

ref1: https://docs.python.org/3/library/uuid.html
ref2: https://pypi.org/project/uuid-utils/0.2.0/
ref3: https://discuss.python.org/t/add-uuid7-in-uuid-module-in-standard-library/44390

Looking forward to your feedback!

sydney-runkle commented 3 weeks ago

Hmph, in that case, we can add support in pydantic-extra-types, but won't offer first class support here until it's included in the stdlib uuid package.