Module

config.env_config

BENGAL_ prefix environment variable overrides (Hugo-style).

Env vars starting with BENGAL_ override config keys.

Underscore = nesting: BENGAL_PARAMS_FOO_BAR → params.foo.bar For keys with underscores, usexas delimiter:

  • BENGALxPARAMSxREPO_URL → params.repo_url
  • BENGALxPARAMSxCOLAB_BRANCH → params.colab_branch
  • BENGALxPARAMSxAPI_KEY → params.api_key

Precedence: BENGAL_ env vars override config file. They run before context inference, so BENGALxPARAMSxREPO_URL takes precedence over GitHub Actions inference.

Functions

_parse_bengal_key 1 list[str] | None
Parse env key into config path. - BENGAL_PARAMS_FOO_BAR → ['params', 'foo', 'b…
def _parse_bengal_key(env_key: str) -> list[str] | None

Parse env key into config path.

  • BENGAL_PARAMS_FOO_BAR → ['params', 'foo', 'bar'] (underscore = nesting)
  • BENGALxPARAMSxREPO_URL → ['params', 'repo_url'] (x = delimiter for keys with underscores)
Parameters
Name Type Description
env_key str
Returns
list[str] | None
_set_nested 3 None
Set config[path[0]][path[1]]...[path[-1]] = value, creating dicts as needed.
def _set_nested(config: dict[str, Any], path: list[str], value: str) -> None
Parameters
Name Type Description
config dict[str, Any]
path list[str]
value str
apply_bengal_overrides 1 dict[str, Any]
Apply BENGAL_* environment variables as config overrides. Iterates os.environ …
def apply_bengal_overrides(config: dict[str, Any]) -> dict[str, Any]

Apply BENGAL_* environment variables as config overrides.

Iterates os.environ for keys starting with BENGAL_, parses the remainder into a config path, and sets the value. Empty values are ignored.

Parameters
Name Type Description
config dict[str, Any]

Configuration dictionary (mutated in place).

Returns
dict[str, Any]