kedro.cli.get_project_context

kedro.cli.get_project_context(key, default=<object object>)[source]

Get a value from the project context. The user is responsible having the specified key in their project’s context which typically is exposed in the __kedro_context__ function in run.py

Parameters:
  • key (Any) – Key in Kedro context dictionary.
  • default (Any) – Default value if the key is not found. If not provided and the key is not found, this will raise a KedroCliError.
Return type:

Any

Returns:

Requested value from Kedro context dictionary or the default if the key was not found.

Raises:

KedroCliError – When the key is not found and the default value was not specified.