svix-ksuid
A pure-Python KSUID implementation
What it is and what it does
Svix-KSUID is a pure-Python implementation of K-sorted unique identifiers, a variant of UUIDs that embed a timestamp component. Unlike standard UUIDs, KSUIDs can be approximately sorted by their creation time without additional metadata. The library provides two modes: standard KSUIDs with 1-second timestamp accuracy, and KsuidMs for 4-millisecond accuracy by trading one byte of random payload. Both modes produce valid, compatible KSUIDs that can be serialized to base62 strings, raw bytes, or reconstructed from either format.
The package handles the full lifecycle of KSUID operations: generation with optional datetime specification, parsing from base62 strings or bytes, timestamp extraction, and comparison operations. It's designed as a lightweight utility for systems that need sortable identifiers with embedded temporal information, commonly used in event logging, database record identification, and distributed systems where ordering by creation time is valuable.
Use it for:
- Generate sortable event IDs in logging systems where chronological ordering is needed without separate timestamps.
- Create database record identifiers that preserve insertion order for efficient range queries and pagination.
- Build distributed system identifiers where multiple services generate IDs independently but need global ordering.
- Replace UUIDs in APIs where clients need to infer approximate creation order from the ID alone.
- Store webhook event identifiers that can be sorted by delivery time without additional metadata lookups.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates and parses KSUIDs (K-sorted unique identifiers) that combine a timestamp with random data, allowing approximate chronological ordering by creation time.
Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and installs with minimal friction. Install it if you need sortable IDs with embedded timestamps; skip it if standard UUIDs or database-generated sequences already fit your use case.
Install
svix-ksuid on PyPI
pip
pip install svix-ksuiduv
uv add svix-ksuidpoetry
poetry add svix-ksuidInstalling svix-ksuid
Before you install
Low install friction with a single pure-Python dependency. The package is actively maintained with recent commits, and requires Python 3.10 or later.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects.
Quickstart
pip install svix-ksuid
from ksuid import Ksuid
ksuid = Ksuid()
print(f"Base62: {ksuid}")
print(f"Timestamp: {ksuid.timestamp}")
print(f"Datetime: {ksuid.datetime}")
Requires Python 3.10 or later.
Verify before relying
- Whether the 4ms accuracy mode (KsuidMs) is suitable for your specific timing requirements compared to the 1-second default.
- Performance characteristics when generating or parsing large volumes of KSUIDs in production workloads.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — python-baseconv |
| Maintenance | actively maintained — 153 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 269,905/month — #8,247 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: svix_ksuid-0.7.0-py3-none-any.whl
Keywords: ksuid, svix
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
ksuidGenerates sortable unique identifiers (KSUIDs)…
permissive · top 15,000 on PyPI
svixSvix is a Python client library for the Svix…
permissive · top 5,000 on PyPI
cyksuidGenerates and parses KSUIDs (K-Sortable…
permissive · top 15,000 on PyPI
pksuidGenerates prefixed, k-sortable unique…
permissive · top 15,000 on PyPI
timeflakeGenerates 128-bit, time-ordered, URL-safe…
permissive · top 15,000 on PyPI
ulidGenerates ULIDs (Universally Unique…
permissive · top 15,000 on PyPI
ulid-pyGenerates and parses ULIDs (Universally Unique…
permissive · top 5,000 on PyPI
uuid-v7Generates UUID v7 and v6 identifiers, extending…
unclear · top 15,000 on PyPI
typeid-pythonGenerates and parses TypeIDs—type-safe,…
permissive · top 15,000 on PyPI
uuid7-standardGenerates and parses UUIDv7 identifiers with…
permissive · top 15,000 on PyPI