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.3.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.3.1
File Size Uploaded
terok_util-0.3.1.tar.gz 253.4 kB Details

Built distribution (wheel)

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

Total release size: 367.7 kB

Release files / terok_util-0.3.1.tar.gz

Download URL terok_util-0.3.1.tar.gz
Size 253.4 kB
Tags Source
SHA-256 checksum
How to use checksums
75e6eaffa9afc59ad6c23600283540ffd9dd116eda66734254e93e4e9b7f7f86
BLAKE2b-256 checksum
How to use checksums
2900ed3fa723b046b04a3549b7e239a0d67382df830205cccdc66094da7a8473
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 11, 2026.

Transparency log

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

Download URL terok_util-0.3.1-py3-none-any.whl
Size 114.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eeabc6359f33781c4aecdf86917a4f583bec5c3b8d2ed24fa17fa3a57b3c6847
BLAKE2b-256 checksum
How to use checksums
c156ac8f7a76cd7abe4178ebcd236c325b92fb6f0401dcd7162211dc752fd039
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 11, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.1

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