Skip to main content
Not everything fits a chapter. Some things fit a labeled junk drawer.
Use this page when you are reading HeavenBase internals and need to recognize a helper. For new application code, prefer the focused pages in this section and the feature docs.

1. Support Helper Menu

Current heavenbase.utils.typing is a migration bridge for common imports. It intentionally does not provide legacy autotype, jsonschema_type, or parse_func_sig.

2. Run a Command

Use cmd(...) when you need stdout, stderr, and the exit code as data.
Ask for one field when the caller only needs that field:
Sequence commands do not invoke a shell unless you pass shell=True. Prefer sequence commands for user-provided values.

3. Map Bounded Work

Use pmap(...) when work can run concurrently and the returned values must stay in input order.
Each item is passed as keyword arguments, so batch items must be mappings. Use batch(...) when you need per-item status, captured exceptions, elapsed time, or progress callbacks.
Async code uses the same contract through abatch(...) and abatch_stream(...).

4. Format Errors and Mismatches

Use raise_mismatch(...) when validation should suggest the closest supported value.
capture_error(...) returns an ErrorRecord that can preserve the original exception through record.reraise().

5. Use Scoped Proxy Settings

Use NetworkProxy when one operation needs temporary HTTP_PROXY, HTTPS_PROXY, or NO_PROXY environment variables.
Existing environment values are restored when the context exits. Passing an empty string disables that proxy variable inside the context.

6. Log and Color Diagnostics

Use get_logger(...) for HeavenBase log output, and redirect_logs(...) or suppress_logs(...) for temporary diagnostic routing.
Color helpers such as cstr(...), color_success(...), and strip_color(...) are for terminal diagnostics. Do not store colored strings in JSON, rows, or benchmark artifacts.

Further Exploration

Related resources:
  • Overview - the guided entry point for this section.
  • File System - local paths and files used by command workflows.
  • Configuration - config defaults for parallel worker limits and logging.
  • Catalog - public naming and object discovery.