skillfed

ulid-transform

Create and transform ULIDs

ulid-transform v2.2.9 779.7K downloads/30d#5,084 on PyPI11
Permissive license MIT Active released

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-transform

uv

uv add ulid-transform

poetry

poetry add ulid-transform

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries

Tags

ulid generationulid conversionsortable unique identifiersulid to bytesulid timestamp extractionfast ulid libraryulid hex conversion
identifier-generationtimestamp-extractionsortable-ids

More Libraries packages