Shortuuid is a Python library that generates concise, unambiguous, and URL-safe UUIDs. It provides a simple API to generate UUIDs, encode integers, and decode strings using a customizable alphabet. The current version is 1.0.13, and releases are infrequent but stable, with a focus on maintenance.
pip install shortuuidVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to generate short UUIDs, specify their length, and encode/decode integers using the default and a custom alphabet.
If you need to decode UUIDs generated with older versions, you must use a `shortuuid` version compatible with their generation. For new projects, ensure all components use 1.0.0+ consistently.
Projects requiring Python 2.x must use `shortuuid` < 1.0.0. For new development, ensure Python 3.6+ is used.
Carefully consider the size and character set of your custom alphabet and the desired length. For most use cases, the default settings are sufficient. If generating many IDs, test for collision rates or stick to longer lengths/richer alphabets.
When using `shortuuid.ShortUUID(alphabet=...)`, double-check that all characters in your custom alphabet are safe for the intended environment or use additional URL/filesystem encoding if necessary.
No dependency data recorded yet.