cyksuid
Cython implementation of ksuid
What it is and what it does
CyKSUID is a Cython-based implementation of KSUID, a sortable unique identifier format that combines a timestamp with random data. It generates IDs that are lexicographically sortable by creation time, making them useful for databases and distributed systems where time-ordered uniqueness matters. The package provides two APIs (v1 and v2) and exposes IDs in multiple formats: raw bytes, hex, base32-encoded strings, and as Python datetime objects.
The library has no runtime dependencies beyond Python and a C compiler, and ships with pre-built wheels for most common platforms. It's positioned as a high-performance alternative to UUID libraries when you need sortability and timestamp extraction without external dependencies. The benchmark data shows it generates IDs roughly 3-4x faster than comparable implementations.
Use it for:
- Generate sortable IDs for database records that need to be ordered by creation time without a separate timestamp column.
- Create distributed system identifiers that are globally unique and time-ordered without requiring a central ID service.
- Replace UUIDs in applications where both uniqueness and sortability are required for efficient indexing.
- Extract creation timestamps from IDs after the fact using the parse function and datetime property.
- Build audit logs or event streams where ID ordering reflects event sequence without explicit timestamps.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates and parses KSUIDs (K-Sortable Globally Unique IDs) using a high-performance Cython implementation, providing sortable unique identifiers with embedded timestamps.
Yes, if you need sortable unique IDs with embedded timestamps and want better performance than pure-Python alternatives. The permissive BSD license, lack of runtime dependencies, and production-stable status make it low-risk. The aging maintenance status (last release 688 days ago) is a minor concern but not a blocker—the code is stable and the repository remains active. Install friction is moderate due to compilation, but pre-built wheels cover most platforms.
Install
cyksuid on PyPI
pip
pip install cyksuiduv
uv add cyksuidpoetry
poetry add cyksuidInstalling cyksuid
Before you install
Medium install friction due to compiled wheels, but pre-built binaries are available for common platforms (macOS, Linux, Windows across x86_64 and ARM). Last release was 688 days ago; repository remains active with recent commits and is marked production-stable.
License in practice
BSD license is permissive and imposes minimal restrictions; you may use, modify, and distribute this package in commercial and private projects with only attribution required.
Quickstart
pip install cyksuid
from cyksuid.v2 import ksuid, parse
uid = ksuid()
print(uid.encoded) # b'2G2IfS6177qFICE3w10eMjgYu89'
print(uid.timestamp) # 1665580354.0
print(uid.datetime) # datetime with UTC timezone
Requires a C compiler at install time if pre-built wheels are unavailable for your platform; Python 3.7 or later.
Verify before relying
- Whether the v1 and v2 APIs are both actively maintained or if v1 is deprecated.
- Performance characteristics under high-concurrency workloads beyond the single-threaded benchmark shown.
- Whether KSUIDs generated by this implementation are compatible with the original Go KSUID library in all edge cases.
- Exact byte length and structure of generated IDs.
Package facts
| License | BSD (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 688 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 213,593/month — #9,433 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cyksuid-2.1.0-cp310-cp310-macosx_10_15_universal2.whl; cyksuid-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl; cyksuid-2.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; cyksuid-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; cyksuid-2.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; cyksuid-2.1.0-cp310-cp310-musllinux_1_1_aarch64.whl; cyksuid-2.1.0-cp310-cp310-musllinux_1_1_x86_64.whl; cyksuid-2.1.0-cp310-cp310-win32.whl; cyksuid-2.1.0-cp310-cp310-win_amd64.whl; cyksuid-2.1.0-cp310-cp310-win_arm64.whl; cyksuid-2.1.0-cp311-cp311-macosx_10_15_universal2.whl; cyksuid-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl; cyksuid-2.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; cyksuid-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; cyksuid-2.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; cyksuid-2.1.0-cp311-cp311-musllinux_1_1_aarch64.whl; cyksuid-2.1.0-cp311-cp311-musllinux_1_1_x86_64.whl; cyksuid-2.1.0-cp311-cp311-win32.whl; cyksuid-2.1.0-cp311-cp311-win_amd64.whl; cyksuid-2.1.0-cp311-cp311-win_arm64.whl
Keywords: ksuid
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
ksuidGenerates sortable unique identifiers (KSUIDs)…
permissive · top 15,000 on PyPI
pksuidGenerates prefixed, k-sortable unique…
permissive · top 15,000 on PyPI
svix-ksuidGenerates and parses KSUIDs (K-sorted unique…
permissive · top 15,000 on PyPI
ulid-pyGenerates and parses ULIDs (Universally Unique…
permissive · top 5,000 on PyPI
ulidGenerates ULIDs (Universally Unique…
permissive · top 15,000 on PyPI
cuidGenerates fast, sequentially-ordered unique…
permissive · top 5,000 on PyPI
python-ulidGenerates and manipulates ULIDs (universally…
permissive · top 5,000 on PyPI
uuid-v7Generates UUID v7 and v6 identifiers, extending…
unclear · top 15,000 on PyPI
ulid-transformGenerate and convert ULIDs (Universally Unique…
permissive · top 15,000 on PyPI
timeflakeGenerates 128-bit, time-ordered, URL-safe…
permissive · top 15,000 on PyPI