class documentation

class KedroContext: (source)

View In Hierarchy

KedroContext is the base class which holds the configuration and Kedro's main functionality.

Method __init__ Create a context object by providing the root of a Kedro project and the environment configuration subfolders (see kedro.config.ConfigLoader)
Property catalog Read-only property referring to Kedro's DataCatalog for this context.
Property config_loader Read-only property referring to Kedro's ConfigLoader for this context.
Property env Property for the current Kedro environment.
Property params Read-only property referring to Kedro's parameters for this context.
Property project_path Read-only property containing Kedro's root project directory.
Method _get_catalog A hook for changing the creation of a DataCatalog instance.
Method _get_config_credentials Getter for credentials specified in credentials directory.
Method _get_feed_dict Get parameters and return the feed dictionary.
Instance Variable _config_loader Undocumented
Instance Variable _env Undocumented
Instance Variable _extra_params Undocumented
Instance Variable _hook_manager Undocumented
Instance Variable _package_name Undocumented
Instance Variable _project_path Undocumented
def __init__(self, package_name: str, project_path: Union[Path, str], config_loader: ConfigLoader, hook_manager: PluginManager, env: str = None, extra_params: Dict[str, Any] = None): (source)

Create a context object by providing the root of a Kedro project and the environment configuration subfolders (see kedro.config.ConfigLoader)

Parameters
package_name:strPackage name for the Kedro project the context is created for.
project_path:Union[Path, str]Project path to define the context for.
config_loader:ConfigLoaderUndocumented
hook_manager:PluginManagerThe PluginManager to activate hooks, supplied by the session.
env:strOptional argument for configuration default environment to be used for running the pipeline. If not specified, it defaults to "local".
extra_params:Dict[str, Any]Optional dictionary containing extra project parameters. If specified, will update (and therefore take precedence over) the parameters retrieved from the project configuration.
Raises
KedroContextErrorIf there is a mismatch between Kedro project version and package version.
@property
catalog: DataCatalog = (source)

Read-only property referring to Kedro's DataCatalog for this context.

Returns
DataCatalog defined in catalog.yml.
Raises
KedroContextErrorIncorrect DataCatalog registered for the project.
@property
config_loader = (source)

Read-only property referring to Kedro's ConfigLoader for this context.

Returns
Instance of ConfigLoader.
Raises
KedroContextErrorIncorrect ConfigLoader registered for the project.
@property
env: Optional[str] = (source)

Property for the current Kedro environment.

Returns
Name of the current Kedro environment.
@property
params: Dict[str, Any] = (source)

Read-only property referring to Kedro's parameters for this context.

Returns
Parameters defined in parameters.yml with the addition of any
extra parameters passed at initialization.
@property
project_path: Path = (source)

Read-only property containing Kedro's root project directory.

Returns
Project directory.
def _get_catalog(self, save_version: str = None, load_versions: Dict[str, str] = None) -> DataCatalog: (source)

A hook for changing the creation of a DataCatalog instance.

Returns
DataCatalogDataCatalog defined in catalog.yml.
Raises
KedroContextErrorIncorrect DataCatalog registered for the project.
def _get_config_credentials(self) -> Dict[str, Any]: (source)

Getter for credentials specified in credentials directory.

def _get_feed_dict(self) -> Dict[str, Any]: (source)

Get parameters and return the feed dictionary.

_config_loader = (source)

Undocumented

Undocumented

_extra_params = (source)

Undocumented

_hook_manager = (source)

Undocumented

_package_name = (source)

Undocumented

_project_path = (source)

Undocumented