httk.workflow.runtime_utils

Safe replacements for small conveniences used by shell runners.

Functions

evaluate_expression(→ int | float | bool)

Evaluate a bounded arithmetic expression without Python eval.

render_template(→ pathlib.Path)

Render string.Template placeholders from an explicit mapping.

compress_files(→ tuple[pathlib.Path, Ellipsis])

Compress regular files atomically with a stdlib codec.

decompress_files(→ tuple[pathlib.Path, Ellipsis])

Decompress .bz2, .gz, or .xz files atomically.

Module Contents

httk.workflow.runtime_utils.evaluate_expression(expression: str) int | float | bool[source]

Evaluate a bounded arithmetic expression without Python eval.

httk.workflow.runtime_utils.render_template(template_path: str | os.PathLike[str], output_path: str | os.PathLike[str], values: collections.abc.Mapping[str, object]) pathlib.Path[source]

Render string.Template placeholders from an explicit mapping.

httk.workflow.runtime_utils.compress_files(paths: collections.abc.Sequence[str | os.PathLike[str]], *, method: str = 'bz2', remove_source: bool = False) tuple[pathlib.Path, Ellipsis][source]

Compress regular files atomically with a stdlib codec.

httk.workflow.runtime_utils.decompress_files(paths: collections.abc.Sequence[str | os.PathLike[str]], *, remove_source: bool = False) tuple[pathlib.Path, Ellipsis][source]

Decompress .bz2, .gz, or .xz files atomically.