Skip to main content

terok-util

terok-util

PyPI License: Apache-2.0 REUSE status

Shared utility library for the terok-* sibling packages.

terok-util sits at the bottom of the terok dependency chain: every sibling package depends on it, and it depends on nothing else in the ecosystem. It collects the small set of cross-cutting bits that would otherwise be duplicated (or quietly diverge) across terok-shield, terok-clearance, terok-sandbox, terok-executor, and terok.

What's in the box

Module Use case
cli_types CommandDef / ArgDef / CommandTree — argparse-driven CLI registry types used by every sibling that exposes a CLI tree.
fs ensure_dir, ensure_dir_writable, write_sensitive_file (atomic O_CREAT | O_EXCL 0o600 writer).
paths namespace_state_dir, namespace_config_dir, namespace_runtime_dir — XDG-aware path resolution for a per-namespace deployment.
config_stack ConfigStack + deep_merge — layered round-trip YAML config merge engine.
security sanitize_tty — strips C0 / C1 / ANSI sequences from untrusted strings before rendering to the operator's terminal (CWE-150 mitigation).
podman podman_userns_args — rootless --userns=keep-id:uid=1000,gid=1000 builder.

Installation

pip install terok-util

The package is published as a Python wheel; siblings pin to a specific GitHub-release wheel URL via pyproject.toml.

Convention

The rule for what belongs here: if two or more terok-* packages need it, it lives in terok-util. Single-package helpers stay in the package that owns them. The __all__ declaration in src/terok_util/__init__.py is the contract — symbols listed there are stable across minor releases.

License

Apache-2.0. See LICENSE.

Metadata

Release files for terok-util 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for terok-util 0.2.1
File Size Uploaded
terok_util-0.2.1.tar.gz 46.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for terok-util 0.2.1
File Interpreter ABI Platform
terok_util-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 118.4 kB

Release files / terok_util-0.2.1.tar.gz

Download URL terok_util-0.2.1.tar.gz
Size 46.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7311147632b585c0e3764ba3092044f5d330e3515327a315866743ef90459e83
BLAKE2b-256 checksum
How to use checksums
0ba7dae8f129ebc55fdb782689556662addeea561a2566c2a23aa146969c6e0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.

Transparency log

Release files / terok_util-0.2.1-py3-none-any.whl

Download URL terok_util-0.2.1-py3-none-any.whl
Size 71.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51a2dd3e5d8de52cc349aa4d3fab46a05c02c190a005525bf5b21c753e421f2f
BLAKE2b-256 checksum
How to use checksums
4308b966d174ece75013178b45d4fe36a34d5c626743daa20967252aeb66c8b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release 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