Skip to main content

suuid

Semantic, filename- and S3-safe UUIDs.

A SUUID is a 3-part identifier you can use directly as an S3 object key, a filename, or a database column name:

<ClassName>__<safe_name>__<huuid>

Data__messung_2026_csv__9e51448c57ab5ef1b92d0c27f554a49e
└─ class    └─ readable name   └─ 32-char hex uuid
  • ClassName — the object/type class, case preserved ([A-Za-z0-9_]).
  • safe_name — a normalised human label ([a-z0-9_], no leading/trailing _).
  • huuid — a 32-char lowercase hex UUID.

The separator is exactly __ and no component contains __ or an edge _, so a SUUID parses back into its three parts unambiguously.

Why

  • Safe as a filename / S3 key. Only [A-Za-z0-9_] after the class, no spaces, no special characters — works on Linux, Windows, S3 and as a DB identifier.
  • Length-bounded. Every sname is ≤ 254 characters, so the metadata sibling key — sname + "_" — still fits the 255-char limit. Store an object under sname and its metadata under meta_name.
  • Reproducible. Name- and content-deterministic modes mean the same input always yields the same identifier, on every run and machine. The rules are frozen and versioned (NORMALIZATION_SPEC).

Install

uv add suuid
# or
uv pip install suuid

Usage

from suuid import SUUID

# Name-deterministic: same (class, name) -> same id, everywhere.
sid = SUUID.from_name("Data", "Messung 2026.csv")
sid.sname        # 'Data__messung_2026_csv__9e51...'
sid.meta_name    # 'Data__messung_2026_csv__9e51..._'  (metadata object key)
sid.huuid        # '9e51448c57ab5ef1b92d0c27f554a49e'
sid.did          # 'did:suuid:Data__messung_2026_csv__9e51...'

# Content-deterministic: same bytes -> same id (content-addressed, dedup).
SUUID.from_content("Doc", "spec.pdf", b"...bytes...")
SUUID.from_file("Doc", "spec.pdf")

# Random (non-reproducible).
SUUID.random("Run", "nightly")

# Round-trips.
SUUID.from_sname(sid.sname) == sid
SUUID.from_compact_token(sid.compact_token) == sid
SUUID.from_dict(sid.to_dict()) == sid

CLI

suuid mint --class Data --name "Messung 2026.csv"
suuid mint --class Doc  --name spec.pdf --mode content --content-file spec.pdf
suuid mint --class Run  --name nightly  --mode random
suuid parse --sname "Data__messung_2026_csv__9e51..."
suuid mint  --class Data --name x --json     # full to_dict() as JSON

The three modes

Mode Constructor huuid Reproducible
name from_name(cls, name) uuid5(NS, upper(class + safe_name)) yes
content from_content(cls, name, bytes) / from_file(cls, path) uuid5(NS, sha3-256(content)) yes (per content)
random random(cls, name) uuid4() no

In content mode the name stays human-readable; only the huuid is derived from the content hash (also exposed as content_hash, full sha3-256 hex).

Length budget

class (≤64) + "__" (2) + safe_name (≤154) + "__" (2) + huuid (32)  =  ≤ 254
                                                          + "_"     =  ≤ 255   (meta_name)

Development

uv sync
uv run pytest
uv run ruff check

Releasing

Published to PyPI via Trusted Publishing on GitHub Release — see RELEASING.md.

License

MIT — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

suuid-0.2.0.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

suuid-0.2.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file suuid-0.2.0.tar.gz.

File metadata

  • Download URL: suuid-0.2.0.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for suuid-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b97c1f5afb34e5a802354edd6ed3f321c4de3885555aed6ba2e0b0dcc09fb0fe
MD5 ce254eb8c8e57f9819d7c67ca0c7ba92
BLAKE2b-256 e4062126282fbd44bf2ba57a5878f4d7b5389de65f17540541b8cb2da64a78e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for suuid-0.2.0.tar.gz:

Publisher: release.yml on lepy/suuid

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file suuid-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: suuid-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for suuid-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd6d54b680d71f7732872a0bcf17e407854a9b5a6aec04bfbef221506e0c80c4
MD5 d4dfba5f45bcaf506d4d126c1b79eb67
BLAKE2b-256 93816b3086d9883960b13c0fa934bc3945c0b57e1c00fe760baa1ca3a6be02f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for suuid-0.2.0-py3-none-any.whl:

Publisher: release.yml on lepy/suuid

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page