IDKit
A small typed identifier system for Python 3.12+.
It lets you build structured identifiers using dot notation:
from idkit import ID
identifier = ID.system.runtime.agent.analyzer
print(identifier)
# system::runtime:agent-analyzer
print(identifier.namespace)
# system::runtime:agent
print(identifier.segment)
# analyzer
print(identifier.path)
# system/runtime/agent/analyzer
print(identifier.slug)
# system-runtime-agent-analyzer
print(identifier.unique("worker-1"))
# system::runtime:agent-analyzer<worker-1>
Format
Group::Source[:Component][-Role][<Unique>]
Examples:
system::runtime
system::runtime
system::runtime:agent
system::runtime:agent-analyzer
system::runtime:agent-analyzer<worker-1>
service::data:resource-ingester
manage::workflow:pipeline-runner
Type aliases
from idkit import Identifier, IDLike, IDable
Use Identifier when you want the concrete identity type.
Use IDLike when your function only needs the public identity interface.
Use IDable when your object exposes an .identifier property.
The root package also exports the generic building blocks:
from idkit import Identity, IdentityLike, Identifiable, IdentityNamespace
from idkit import IDLike
def register(identifier: IDLike) -> None:
identifier.require_complete()
print(identifier.value)
Installation
pip install idkit
Parsing
parsed = ID.parse("system::runtime:agent-analyzer")
assert parsed == ID.system.runtime.agent.analyzer
unique = ID.parse("system::runtime:agent-analyzer<worker-1>")
assert unique == ID.system.runtime.agent.analyzer.unique("worker-1")
Matching
identifier = ID.system.runtime.agent.analyzer
identifier.matches(ID.system)
# True
identifier.matches(ID.system.runtime)
# True
identifier.matches(ID.system.runtime.agent)
# True
identifier.matches(ID.service)
# False
Parent traversal
identifier = ID.system.runtime.agent.analyzer
identifier.parent
# Identifier('system::runtime:agent')
identifier.parent.parent
# Identifier('system::runtime')
identifier.parent.parent.parent
# Identifier('system')
Development
Run tests:
python3 -m pytest
Metadata
Release files for IDKit 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| idkit-1.0.4.tar.gz | 14.1 kB | Without provenance | Details for idkit-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| idkit-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for idkit-1.0.4-py3-none-any.whl |
Total release size: 28.9 kB
Release files / idkit-1.0.4.tar.gz
| Download URL | idkit-1.0.4.tar.gz |
|---|---|
| Size | 14.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d408ebc6a719be48240e1aee1636e73314f84709a0870fdaea9b4659d568fa5
|
|
BLAKE2b-256 checksum How to use checksums |
5ee512bf36ebefa5351dc6926b450d3da36c550771884ce1c27e309d0fbbd1b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / idkit-1.0.4-py3-none-any.whl
| Download URL | idkit-1.0.4-py3-none-any.whl |
|---|---|
| Size | 14.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0dbf11054ffb28d7ac7f5cdae2ecc355dd23290b6a2c060fcb8e4ac9742674e2
|
|
BLAKE2b-256 checksum How to use checksums |
7d32f17c8e56ffab640c2ee1d973965e8950f46a869c728bb602ed844d2fb4cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for IDKit 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.