--- id: cyksuid version: "2.1.0" license: BSD license_treatment: permissive maintenance: aging --- # cyksuid — Cython implementation of ksuid License: permissive · Maintenance: aging · Downloads: 213.6K/mo ## 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 above — 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 pip install cyksuid uv add cyksuid poetry add cyksuid ## Installing 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_current - Install friction: medium - Maintenance: aging - Downloads: 213.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags ksuid generation python, sortable unique id generator, k-sortable globally unique ids, timestamp-based uuid alternative, cython uuid library, distributed id generation, unique-ids, sortable-identifiers, distributed-systems [View on SkillFed](https://skillfed.io/packages/cyksuid) · [View on PyPI](https://pypi.org/project/cyksuid/)