python-ulid
Universally unique lexicographically sortable identifier
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, installs with minimal friction (one lightweight dependency), supports current Python versions (3.10–3.14), and solves a real problem for applications needing sortable unique identifiers. Use it whenever you need UUIDs but want sortability and compactness.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction: pure Python wheel with only typing-extensions as a runtime dependency.
- Active maintenance with a release 25 days ago and recent commits.
License · maintenance · safety
MIT (permissive) — MIT license (permissive): you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2026-07-20 (25 days) · last repo commit 2026-07-23 · 566 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 10,132,513 downloads/mo, #1,477 on PyPI
Alternatives
Verify before relying
pip install python-ulid
from ulid import ULID
ulid = ULID()
print(str(ulid)) # e.g., '01BTGNYV6HRNK8K8VKZASZCFPE'
print(ulid.datetime) # extract timestamp as datetime- Performance characteristics under high-throughput generation (monotonicity policy overhead not quantified).
- Whether Pydantic integration requires the optional pydantic extra or works with core install.
What it is and what it does
python-ulid is a library for creating and working with ULIDs, a 128-bit identifier format that combines a 48-bit millisecond timestamp with 80 bits of randomness. Unlike UUIDs, ULIDs are lexicographically sortable, meaning they sort correctly by creation time without additional logic. They encode to a compact 26-character base32 string (versus UUID's 36 characters) and are URL-safe with no special characters.
The library provides multiple ways to generate ULIDs (from current time, from a specific timestamp, from a datetime object), convert them to various formats (string, hex, int, bytes, UUID), and extract the timestamp component. It includes customizable monotonicity policies to handle collisions when multiple ULIDs are generated within the same millisecond, optional Pydantic integration for data validation, and a command-line interface for generating and inspecting ULIDs.
Use it for
- Generate sortable primary keys for database records that preserve insertion order without a separate sequence.
- Create distributed IDs across multiple services without coordination, using timestamp + randomness to avoid collisions.
- Replace UUIDs in APIs and URLs where a shorter, more readable identifier is preferred.
- Build audit logs or event streams where IDs must be both unique and sortable by time.
- Validate ULID strings in Pydantic models for API request/response schemas.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, installs with minimal friction (one lightweight dependency), supports current Python versions (3.10–3.14), and solves a real problem for applications needing sortable unique identifiers. Use it whenever you need UUIDs but want sortability and compactness.
Install
python-ulid on PyPI
Before you install
Low friction: pure Python wheel with only typing-extensions as a runtime dependency. Active maintenance with a release 25 days ago and recent commits.
Requires Python 3.10 or later.
License in practice
MIT license (permissive): you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install python-ulid
from ulid import ULID
ulid = ULID()
print(str(ulid)) # e.g., '01BTGNYV6HRNK8K8VKZASZCFPE'
print(ulid.datetime) # extract timestamp as datetime
Verify before relying
- Performance characteristics under high-throughput generation (monotonicity policy overhead not quantified).
- Whether Pydantic integration requires the optional pydantic extra or works with core install.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetyping-extensions |
| Maintenance | Actively maintained 25 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 10,132,513 / month, #1,477 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries |
Evidence: python_ulid-4.0.1-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 › “base32 encoded ID”
- python-ulidGenerates and manipulates ULIDs (universally unique lexicographically…
- ulid-pyGenerates and parses ULIDs (Universally Unique Lexicographically…
- ulidGenerates ULIDs (Universally Unique Lexicographically Sortable…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also py-deviceid · ulid · ulid-py · timeflake · ulid-transform · uuid-extension · uuid-v7 · ksuid · uuid-utils · typeid-python