Python UUID libraries

Updated Nov 2026

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.

LibraryMonthly downloadsStarsLast releaseLicense
uuid-utils
92.5M
375Oct 2026BSD-3-Clause
fastuuid
85.4M
Not on GitHubOct 2025BSD-3-Clause
shortuuid
24.7M
2.2KMar 2024BSD-3-Clause
uuid6
11.4M
182Jul 2025MIT
uuid7-standard
318.0K
Not on GitHubSep 2026MIT OR Unlicense
Downloads: pypi, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Features compared

LibraryFinal-standard time-ordered UUIDsBulk random UUID generationCustom alphabet codecExplicit time argument
uuid-utilsBuilt-inUnsupportedUnsupportedBuilt-in
fastuuidBuilt-inBuilt-inUnsupportedUnsupported
shortuuidUnsupportedUnsupportedBuilt-inUnsupported
uuid6Built-inUnsupportedUnsupportedUnsupported
uuid7-standardBuilt-inUnsupportedUnsupportedBuilt-in
Built-inNot supported

Libraries and code examples

Provides Rust-backed UUID generation with an optional standard-library compatibility interface.

Downloads / mo
92.5M
Stars
375
Last release
1.2.0
License
BSD-3-Clause

Strengths

  • Provides random and named identifiers. Generate random UUIDs or derive them from a name and namespace.
  • Returns standard-library objects through compatibility. Use uuid_utils.compat when a framework requires standard-library UUID objects.

Limitations

  • Default object types can conflict. Switch to uuid_utils.compat for frameworks requiring standard-library UUID instances.

Quickstart

From README.md
$ python -m pip install uuid-utils==1.2.0
import uuid_utils

print(uuid_utils.uuid4())

uuid-utils examples

From open-source projects on GitHub
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()

Provides Python bindings to Rust's UUID library.

Downloads / mo
85.4M
Last release
0.14.0
License
BSD-3-Clause

Quickstart

From README.rst
$ python -m pip install fastuuid==0.14.0
import fastuuid

print(fastuuid.uuid4())

Encodes UUIDs as compact strings using a customizable alphabet.

Downloads / mo
24.7M
Stars
2.2K
Last release
1.0.13
License
BSD-3-Clause

Strengths

  • Produces compact readable identifiers. The default alphabet removes similar-looking characters.
  • Converts existing UUIDs both ways. Use encode and decode to round-trip an existing UUID.

Limitations

  • Truncation discards identifier information. Shortened strings lose the original UUID’s uniqueness properties.
  • Older encodings need legacy decoding. Use legacy=True when decoding strings from the old encoding.

Quickstart

From README.md
$ python -m pip install shortuuid==1.0.13
import shortuuid

print(shortuuid.uuid())

shortuuid examples

From open-source projects on GitHub

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.

Quickstart

From README.md
$ python -m pip install uuid6==2025.0.1
from uuid6 import uuid7

print(uuid7())

uuid6 examples

From open-source projects on GitHub

uuid7-standard

Pure Python UUIDv7 with datetime-based creation and timestamp extraction, filling gaps in stdlib and other implementations.

Downloads / mo
318.0K
Last release
1.1.2
License
MIT OR Unlicense

Quickstart

From README.md
$ python -m pip install uuid7-standard==1.1.2
import uuid7

print(uuid7.create())

FAQ

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.

Run in your terminal

claude plugin install exa@claude-plugins-official