Use this file to discover Exa products, pricing, evaluations, comparisons, use cases, agent interfaces, and technical documentation before exploring further.
Python UUID libraries generate universally unique identifiers beyond what the standard library's uuid module offers. A time-ordered UUID places a timestamp in its leading bits rather than filling every bit at random. These libraries let apps and databases create sortable identifiers that stay unique across machines.
Popularity
uuid-utils has the most monthly downloads in this comparison, at 92.5M.
def uuid7() -> UUID:
"""
Generate a UUIDv7 using the uuid_utils compatibility layer.
This ensures type compatibility with the rest of the TensorZero client.
"""
return compat.uuid7()
def create_uuid(self):
if not self.version or self.version == 4:
return shortuuid.uuid()
elif self.version == 1:
return shortuuid.uuid()
elif self.version == 2:
raise UUIDVersionError("UUID version 2 is not supported.")
elif self.version == 3:
raise UUIDVersionError("UUID version 3 is not supported.")
elif self.version == 5:
return shortuuid.uuid(name=self.namespace)
else:
raise UUIDVersionError("UUID version %s is not valid." % self.version)
uuid6
Generates time-based UUIDs and converts legacy time-based UUIDs to reordered UUIDs.
Downloads / mo
11.4M
Stars
182
Last release
2025.0.1
License
MIT
Strengths
Generates time-ordered identifiers.Use uuid7 for identifiers ordered by their timestamp.
Converts legacy UUIDs.Use uuid1_to_uuid6 to reorder an existing version-one UUID.
Limitations
Generation needs thread coordination.Its time-based generation functions are not thread-safe.
def uuid7_range_bound(dt: datetime) -> UUID:
"""
Returns the lowest UUIDv7 whose timestamp is the millisecond containing `dt`.
Partition bounds have to be derived, not generated: two calls for the same
instant must give the same literal, and consecutive windows must meet
exactly. `datetime_to_uuid7` fills the sequence and node fields with
randomness, which is right for an identifier and wrong for a bound -- a
bound a millisecond wide with a random tail leaves the values above it in
that millisecond outside every partition.
The millisecond is counted with integer arithmetic rather than through
`dt.timestamp() * 1000`: past year 2249 a float second no longer resolves a
millisecond, so an instant in the last microsecond of one rounds up into the
next, putting the bound a millisecond above the values it exists to include.
Args:
dt: The instant the bound sits at. A naive `dt` is read as local time,
the same way `datetime.timestamp()` reads it.
Returns:
UUID: The smallest UUIDv7 in `dt`'s millisecond.
"""
since_epoch = dt.astimezone(UTC) - datetime(1970, 1, 1, tzinfo=UTC)
timestamp_ms = (since_epoch // timedelta(milliseconds=1)) & 0xFFFFFFFFFFFF
# Version 7 in bits 76-79 and variant "10" in bits 62-63; every other bit zero. return UUID(int=(timestamp_ms << 80) | (0x7 << 76) | (0x2 << 62))
uuid7-standard
Pure Python UUIDv7 with datetime-based creation and timestamp extraction, filling gaps in stdlib and other implementations.
uuid-utils suits fast UUID generation, with a compatibility module for frameworks that need standard-library objects. uuid6 suits time-ordered identifiers and conversion of legacy time-based UUIDs. shortuuid suits compact, readable identifiers.
uuid6 generates identifiers ordered by their timestamp. Its time-based generation functions are not thread-safe.
Through uuid_utils.compat. That module returns standard-library UUID objects for frameworks that require them.
shortuuid encodes UUIDs as compact strings with an alphabet that removes similar-looking characters. Its encode and decode functions round-trip an existing UUID.
For coding agents
Found your UUID library? Help your agent use it.
Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.