Config helpers¶
The file-loading edge, for a loader that does its own parsing.
Most apps want BaseAppConfig and load_app_config instead.
opennvr_app_sdk.load_yaml
¶
load_yaml(path: str | Path) -> dict[str, Any]
Read + parse a YAML config file, requiring a mapping at the root.
Raises ValueError on a non-mapping root and lets OSError
from the read propagate — callers surface both as operator-facing
config errors and exit non-zero.
Source code in opennvr_app_sdk/config.py
22 23 24 25 26 27 28 29 30 31 | |
opennvr_app_sdk.require
¶
require(
cfg: dict[str, Any], key: str, *, path: str = "config"
) -> Any
Fetch a required config value, rejecting missing / empty values.
path names the config source in the error message (file path or
a nested-section breadcrumb like "config: cameras[0]").
Source code in opennvr_app_sdk/config.py
34 35 36 37 38 39 40 41 42 | |