shortuuid
A generator library for concise, unambiguous and URL-safe UUIDs.
Decision gist · record as of 2026-08-14
Yes. shortuuid is lightweight (no dependencies), actively maintained, permissively licensed, and solves a common problem—making UUIDs human-friendly. Install it if you need shorter, URL-safe identifiers for user-facing contexts. No security vulnerabilities are known, and it ranks in the top 1000 PyPI packages by download volume.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python, no runtime dependencies, and actively maintained with recent commits.
- Supports Python 3.6 through 3.11.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause (permissive): you may use, modify, and distribute shortuuid freely in commercial and private projects, provided you include the license notice.
last release 2024-03-11 (886 days) · last repo commit 2026-06-20 · 2,196 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 24,122,699 downloads/mo, #926 on PyPI
Alternatives
Verify before relying
pip install shortuuid
import shortuuid
# Generate a short UUID
short_id = shortuuid.uuid()
print(short_id) # e.g., 'vytxeTZskVKR7C7WgdSP3d'
# Generate a random secure string
random_str = shortuuid.ShortUUID().random(length=22)
print(random_str) # e.g., 'RaF56o2r58hTKT7AYS9doj'- Collision probability for truncated IDs shorter than the default 22 characters—the description says it 'will still be very low' but does not quantify it.
- Performance characteristics when generating large batches of IDs or with custom alphabets.
What it is and what it does
shortuuid wraps Python's built-in uuid module and translates the result into a shorter, more readable base57 string by removing visually similar characters (l, 1, I, O, 0). The default output is 22 characters long and URL-safe, making it suitable for user-facing identifiers where standard UUIDs are too verbose. It also supports encoding existing UUIDs, generating cryptographically secure random strings, and per-thread alphabet customization via the ShortUUID class.
The package includes a Django field that auto-generates short UUIDs as model defaults, and a command-line tool for quick ID generation. It has no external runtime dependencies and works across Python 3.6+, making it lightweight to add to any project that needs compact, unambiguous identifiers for URLs, APIs, or databases.
Use it for
- Generate short, readable IDs for user-facing URLs or API endpoints instead of full UUIDs.
- Encode existing UUID objects to shorter strings for storage or transmission.
- Use as a Django model field for auto-generated primary keys or API tokens with custom length and alphabet.
- Create cryptographically secure random strings of arbitrary length for tokens or secrets.
- Generate IDs from DNS or URL namespaces using UUID v5 for deterministic, reproducible short identifiers.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
shortuuid is lightweight (no dependencies), actively maintained, permissively licensed, and solves a common problem—making UUIDs human-friendly. Install it if you need shorter, URL-safe identifiers for user-facing contexts. No security vulnerabilities are known, and it ranks in the top 1000 PyPI packages by download volume.
Install
shortuuid on PyPI
Before you install
Low friction: pure Python, no runtime dependencies, and actively maintained with recent commits. Supports Python 3.6 through 3.11.
License in practice
BSD-3-Clause (permissive): you may use, modify, and distribute shortuuid freely in commercial and private projects, provided you include the license notice.
Quickstart
pip install shortuuid
import shortuuid
# Generate a short UUID
short_id = shortuuid.uuid()
print(short_id) # e.g., 'vytxeTZskVKR7C7WgdSP3d'
# Generate a random secure string
random_str = shortuuid.ShortUUID().random(length=22)
print(random_str) # e.g., 'RaF56o2r58hTKT7AYS9doj'
Verify before relying
- Collision probability for truncated IDs shorter than the default 22 characters—the description says it 'will still be very low' but does not quantify it.
- Performance characteristics when generating large batches of IDs or with custom alphabets.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 886 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 24,122,699 / month, #926 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: BSD LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules |
Evidence: shortuuid-1.0.13-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “short uuid generator”
- shortuuidGenerates concise, URL-safe unique identifiers by encoding UUIDs into…
- nanoidGenerates cryptographically secure, URL-friendly unique IDs shorter…
- fastnanoidGenerates unique, URL-friendly string IDs using a Rust-backed…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also nanoid · sqids · fastnanoid · hashids · ulid · pybase62 · timeflake · fastuuid · django-hashids · django-sqids