A Python library for generating concise, unambiguous, and URL-safe UUIDs using a custom base57 alphabet.
Shortuuid is a Python library that generates concise, unambiguous, and URL-safe UUIDs. It converts standard UUIDs into shorter strings using a custom base57 alphabet, removing visually similar characters to prevent confusion. This is particularly useful for generating IDs that need to be user-friendly, such as in URLs, API keys, or database fields.
Python developers and Django users who need to generate readable, non-sequential unique identifiers for user-facing applications, such as web APIs, databases, or URL shorteners.
Developers choose Shortuuid because it provides a simple, reliable way to create compact IDs that retain UUID uniqueness while being easier to handle and display than traditional UUIDs. Its flexibility with custom alphabets and seamless Django integration make it a versatile tool for various projects.
A generator library for concise, unambiguous and URL-safe UUIDs.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses a base57 alphabet that excludes ambiguous characters like l, 1, I, O, and 0, ensuring IDs are safe for URLs and easy for humans to read without confusion.
Allows setting and using custom alphabets with automatic deduplication and sorting, providing flexibility for tailored ID generation, as shown in the set_alphabet() examples.
Includes a ShortUUIDField for Django models, enabling easy database integration with minimal setup and customizable parameters like length and alphabet.
Provides encode() and decode() functions to convert between standard UUID objects and shortuuid strings, maintaining uniqueness and enabling serialization for distributed systems.
Versions prior to 1.0.0 generated UUIDs with reversed bits, requiring the legacy=True flag for decoding, which complicates data migration and adds maintenance overhead.
Shortening IDs by truncation increases collision probability, as admitted in the README, making it risky for applications where guaranteed uniqueness is essential.
Limited to Python environments, so it's not suitable for projects involving multiple programming languages or requiring cross-platform UUID generation without additional work.