--- id: ksuid version: "1.3" license: MIT license_treatment: permissive maintenance: active --- # ksuid — A small python package for creating ksuids License: permissive · Maintenance: active · Downloads: 93.4K/mo ## What it is and what it does KSUID is a Python library for generating K-sorted unique identifiers—20-byte values combining a 4-byte timestamp with 16 bytes of random data. The timestamp component allows KSUIDs to be naturally sorted by creation time, addressing a key limitation of UUIDs. The library provides methods to extract the timestamp, convert to datetime objects, serialize to bytes, and encode/decode using Base62 for compact string representation. The package has no runtime dependencies and is designed as a lightweight utility for applications needing distributed, time-ordered ID generation. It's particularly useful in systems where both uniqueness and temporal ordering matter, such as event logging, database record tracking, or distributed systems requiring causality-aware identifiers. Use it for: - Generate time-ordered event IDs in logging or audit systems where both uniqueness and chronological sorting are needed - Create sortable primary keys for database records that reflect insertion order without explicit timestamp columns - Assign unique identifiers in distributed systems where multiple nodes generate IDs independently without coordination - Serialize IDs to compact Base62 strings for use in URLs or user-facing identifiers - Replace UUID4 in applications where the 122-bit entropy of UUIDs is insufficient and time-ordering is valuable ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates sortable unique identifiers (KSUIDs) that combine a timestamp with random data, enabling time-ordered ID generation without external dependencies. Yes, if you need sortable unique identifiers and can tolerate source-only installation. The package is stable, dependency-free, and solves a real problem (time-ordered IDs) that standard UUIDs don't address. However, verify Python 3.x compatibility with your target version before committing, and be aware that no release has shipped since 2017 despite active repository maintenance—this suggests the code is considered complete rather than actively developed. ## Install pip install ksuid uv add ksuid poetry add ksuid ## Installing ksuid Before you install: High install friction due to source-only distribution (ksuid-1.3.tar.gz). Repository shows active maintenance with recent commits (2026-04-13), but the package has not received a release update since 2017-06-12, suggesting the codebase is stable but not actively developed. License in practice: MIT license is permissive, allowing use in commercial and proprietary projects with minimal restrictions beyond attribution. Quickstart: pip install ksuid from ksuid import ksuid x = ksuid() print(x) print(x.getTimestamp()) print(x.toBase62()) Python 3.x required; currently only tested for Python 3.x per documentation. Verify before relying: - Whether the package works reliably with modern Python versions (3.10+) given no release since 2017 - Performance characteristics under high-volume ID generation - Collision probability claims relative to UUID4 in production scenarios ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: high - Maintenance: active - Downloads: 93.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sortable unique id generator, timestamp-based uid, ksuid python, time-ordered identifier, base62 encoded id, uuid alternative, distributed id generation, id-generation, distributed-systems [View on SkillFed](https://skillfed.io/packages/ksuid) · [View on PyPI](https://pypi.org/project/ksuid/)