skillfed

pksuid

Python package for generating prefixed ksuids.

pksuid v1.1.2 359.2K downloads/30d#7,252 on PyPI1
Permissive license MIT Abandoned released

What it is and what it does

PKSUID is a Python implementation of prefixed k-sortable unique identifiers, extending the KSUID specification (originally from Segment.io) by adding a human-readable prefix inspired by Stripe's ID format. When you generate a PKSUID with a prefix like 'usr', you get an identifier such as 'usr_24OnhzwMpa4sh0NQmTmICTYuFaD'—the prefix immediately signals the resource type, making logs and traces easier to read and debug.

The library encodes a timestamp and a random payload into each ID, making them sortable by creation time. You can extract the prefix, timestamp, datetime, and raw payload from any PKSUID, parse IDs back from string or byte representations, and compare IDs using standard comparison operators. The package depends only on pybase62 for base-62 encoding and is tested on Python 3.6 through 3.10.

Use it for:

  • Generate resource IDs in APIs or databases where you want the type visible at a glance (e.g., 'usr_...', 'txn_...').
  • Create sortable audit logs or event streams where IDs encode creation time and can be ordered without a separate timestamp field.
  • Parse and extract metadata (prefix, timestamp, payload) from existing PKSUIDs for debugging or resource tracking.
  • Replace generic UUIDs in microservices where human-readable prefixes improve operational visibility.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates prefixed, k-sortable unique identifiers (PKSUIDs) that combine a human-readable prefix with a timestamp and random payload, making resource types immediately visible in logs and traces.

No. The package is abandoned (last release 2022-05-07, no commits since) and receives no maintenance or security updates. While the code is simple and low-friction to install, relying on unmaintained ID generation in production is a risk. For new projects, consider an actively maintained alternative; for existing code already using pksuid, evaluate whether you can migrate to a supported library.

Install

pksuid on PyPI

pip

pip install pksuid

uv

uv add pksuid

poetry

poetry add pksuid

Installing pksuid

Before you install

Low install friction; pure Python wheel with a single dependency (pybase62). However, the package is abandoned—last release was 2022-05-07 and no commits since then. No maintenance or security updates are forthcoming.

License in practice

MIT license is permissive and imposes no restrictions on use, modification, or redistribution in commercial or private projects.

Quickstart

pip install pksuid

from pksuid import PKSUID

# Generate a new prefixed ID
uid = PKSUID('usr')
print(uid)  # e.g., 'usr_24OnhzwMpa4sh0NQmTmICTYuFaD'

# Extract components
print(uid.get_prefix())      # 'usr'
print(uid.get_timestamp())   # Unix timestamp
print(uid.get_datetime())    # Human-readable datetime

# Parse from string
uid_from_string = PKSUID.parse('usr_24OnhzwMpa4sh0NQmTmICTYuFaD')
print(uid_from_string.get_timestamp())

Verify before relying

  • Whether the package remains compatible with Python versions released after 2022-05-07.
  • Whether pybase62 has received security or compatibility updates that pksuid does not track.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.6,<4.0)
Install friction low — pure-Python wheel
Runtime dependencies 1 — pybase62
Maintenance abandoned — 1,560 days since the last release
Last repo commit
First released
Downloads 359,190/month — #7,252 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pksuid-1.1.2-py3-none-any.whl

Keywords: uid, uuid, ksuid, pksuid

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

prefixed unique identifier generationksuid with prefixsortable id generatorresource type prefix idstimestamp-based unique idshuman-readable unique identifiers
unique-identifiersabandoned

More Software Development packages