yera.config.storage.read

TOML reading helpers for config.

Symbols

def read_pyproject_yera — Read the discovered project configuration's `[tool.yera]` table.
def read_pyproject_yera_apps_dir — Return the resolved apps directory from ``[tool.yera] apps_dir``, or None.
def read_toml_at_path — Read a TOML file, returning an empty mapping when it is missing.
def read_yera_toml — Read `yera.toml` using the resolved configuration path.

read_pyproject_yera

read_pyproject_yera() → dict[str, TomlValue]

Read the discovered project configuration's [tool.yera] table.

Returns

type: dict[str, TomlValue]

The Yera project configuration, or an empty mapping when unavailable.

read_pyproject_yera_apps_dir

read_pyproject_yera_apps_dir() → Path | None

Return the resolved apps directory from [tool.yera] apps_dir, or None.

The path is resolved relative to the directory containing the discovered pyproject.toml, not relative to cwd. Returns None when the key is absent, the value is not a string, or no qualifying pyproject.toml is found.

Returns

type: Path | None

The resolved applications directory, or None when not configured.

read_toml_at_path

read_toml_at_path(
    path: Path,
) → dict[str, TomlValue]

Read a TOML file, returning an empty mapping when it is missing.

Parameters

path
type: Path

TOML document path.

Returns

type: dict[str, TomlValue]

The decoded TOML data, or an empty mapping when no file exists.

read_yera_toml

read_yera_toml() → dict[str, TomlValue]

Read yera.toml using the resolved configuration path.

Returns

type: dict[str, TomlValue]

The decoded global Yera configuration.