ulid-transform
Create and transform ULIDs
What it is and what it does
ulid-transform is a library for creating and converting ULIDs—sortable unique identifiers with timestamp components. It provides functions to generate new ULIDs, extract timestamps from existing ones, and convert between string, bytes, and hexadecimal representations. The library uses a C++ implementation when available for speed, automatically falling back to pure Python if the compiled extension cannot be loaded, ensuring it works across all supported platforms without requiring manual configuration.
The package targets developers building systems that need sortable, time-ordered identifiers—common in databases, distributed systems, and event logging. With no runtime dependencies and support for Python 3.11 through 3.14, it integrates easily into existing projects. The dual implementation strategy means you get performance when possible but never fail to function.
Use it for:
- Generate sortable unique IDs for database records that maintain insertion order without a separate timestamp column
- Extract millisecond-precision timestamps from existing ULIDs for audit trails or time-series analysis
- Convert between ULID string format and binary representation for efficient storage or network transmission
- Create ULIDs at specific historical timestamps for backfilling or testing time-dependent logic
- Safely handle ULID conversions with None-aware functions in data pipelines that may encounter missing values
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generate and convert ULIDs (Universally Unique Lexicographically Sortable Identifiers) with optional C++ acceleration, falling back to pure Python when unavailable.
Yes. The package is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and provides a focused, zero-dependency solution for ULID operations. Medium install friction is offset by prebuilt wheels for all major platforms and Python versions. Install if you need sortable unique identifiers with timestamp extraction.
Install
ulid-transform on PyPI
pip
pip install ulid-transformuv
uv add ulid-transformpoetry
poetry add ulid-transformInstalling ulid-transform
Before you install
Medium install friction due to compiled wheels for multiple platforms and Python versions (3.11–3.14). Active maintenance with recent release (81 days ago) and no known vulnerabilities.
License in practice
MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal attribution requirements.
Quickstart
pip install ulid-transform
import ulid_transform
# Generate a new ULID
ulid_str = ulid_transform.ulid_now()
print(ulid_str) # e.g., '0001HZX0NW00GW0X476W5TVBFE'
# Extract timestamp (milliseconds since epoch)
ts = ulid_transform.ulid_to_timestamp(ulid_str)
print(ts) # e.g., 1677623996
# Convert to bytes
ulid_bytes = ulid_transform.ulid_to_bytes(ulid_str)
print(ulid_bytes) # e.g., b'\x00\x00c\xfe\x82\xbc...'
Requires Python 3.11 or later; C++ extension wheels are provided for common platforms but pure Python fallback is available.
Verify before relying
- Whether the C++ extension provides measurable performance gains over pure Python for typical workloads
- Compatibility with Python 3.14 given it is listed in classifiers but may be pre-release
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 81 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 779,718/month — #5,084 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ulid_transform-2.2.9-cp311-cp311-macosx_11_0_arm64.whl; ulid_transform-2.2.9-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; ulid_transform-2.2.9-cp311-cp311-manylinux_2_24_armv7l.manylinux_2_31_armv7l.whl; ulid_transform-2.2.9-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; ulid_transform-2.2.9-cp311-cp311-musllinux_1_2_aarch64.whl; ulid_transform-2.2.9-cp311-cp311-musllinux_1_2_armv7l.whl; ulid_transform-2.2.9-cp311-cp311-musllinux_1_2_x86_64.whl; ulid_transform-2.2.9-cp311-cp311-win32.whl; ulid_transform-2.2.9-cp311-cp311-win_amd64.whl; ulid_transform-2.2.9-cp312-cp312-macosx_11_0_arm64.whl; ulid_transform-2.2.9-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; ulid_transform-2.2.9-cp312-cp312-manylinux_2_24_armv7l.manylinux_2_31_armv7l.whl; ulid_transform-2.2.9-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; ulid_transform-2.2.9-cp312-cp312-musllinux_1_2_aarch64.whl; ulid_transform-2.2.9-cp312-cp312-musllinux_1_2_armv7l.whl; ulid_transform-2.2.9-cp312-cp312-musllinux_1_2_x86_64.whl; ulid_transform-2.2.9-cp312-cp312-win32.whl; ulid_transform-2.2.9-cp312-cp312-win_amd64.whl; ulid_transform-2.2.9-cp313-cp313-macosx_11_0_arm64.whl; ulid_transform-2.2.9-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
ulidGenerates ULIDs (Universally Unique…
permissive · top 15,000 on PyPI
python-ulidGenerates and manipulates ULIDs (universally…
permissive · top 5,000 on PyPI
ulid-pyGenerates and parses ULIDs (Universally Unique…
permissive · top 5,000 on PyPI
cyksuidGenerates and parses KSUIDs (K-Sortable…
permissive · top 15,000 on PyPI
typeid-pythonGenerates and parses TypeIDs—type-safe,…
permissive · top 15,000 on PyPI
uuid-v7Generates UUID v7 and v6 identifiers, extending…
unclear · top 15,000 on PyPI
ksuidGenerates sortable unique identifiers (KSUIDs)…
permissive · top 15,000 on PyPI
uuid7Generates version 7 UUIDs that are…
permissive · top 5,000 on PyPI
timeflakeGenerates 128-bit, time-ordered, URL-safe…
permissive · top 15,000 on PyPI
uuid-extensionGenerates UUID version 7…
unclear · top 15,000 on PyPI