python-ulid is a Python library that provides Universally Unique Lexicographically Sortable Identifiers (ULIDs). ULIDs are designed to be compatible with UUIDs but offer better performance for database indexing due to their time-based sort order. The library is actively maintained with regular updates, currently at version 3.1.0, and often introduces new features and stricter validation.
pip install python-ulidVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to generate ULIDs, convert them to string and bytes, parse them from strings, and shows the monotonicity feature introduced in 3.1.0 for sub-millisecond generation. It also includes conversion to UUIDs.
Update exception handling for `ULID` constructor calls. Ensure correct types are passed to the constructor.
Ensure all input strings for ULID parsing strictly adhere to the ULID specification (Base32 alphabet, valid timestamp range). Implement robust error handling for parsing operations, particularly around `ULID.parse()` or `ULID.from_str()`.
Be aware of this behavior if your application relies on entirely independent random components even for sub-millisecond generation. For most use cases, this improves lexicographical sortability and is the desired behavior.
Upgrade `python-ulid` to version 2.3.0 or newer for full Pydantic v2 compatibility and improved JSON schema generation.
No dependency data recorded yet.