Skip to content

kedro.inspection

kedro.inspection

Kedro inspection API for read-only project snapshot.

Name Type Description
get_project_snapshot Function Return a read-only snapshot of a Kedro project.

kedro.inspection.get_project_snapshot

get_project_snapshot(project_path, env=None)

Return a read-only snapshot of the Kedro project at project_path.

This is the primary entry point for the inspection API. It initialises the project, loads configuration and pipelines, and assembles a ProjectSnapshot without executing any pipeline nodes or writing data.

Parameters:

  • project_path (str | Path) –

    Path to the project root directory (the directory that contains pyproject.toml).

  • env (str | None, default: None ) –

    Optional run environment override (e.g. "staging"). When None, the project's default run environment is used.

Returns:

Source code in kedro/inspection/__init__.py
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def get_project_snapshot(
    project_path: str | Path,
    env: str | None = None,
) -> ProjectSnapshot:
    """Return a read-only snapshot of the Kedro project at *project_path*.

    This is the primary entry point for the inspection API. It initialises
    the project, loads configuration and pipelines, and assembles a
    ``ProjectSnapshot`` without executing any pipeline nodes or writing data.

    Args:
        project_path: Path to the project root directory (the directory that
            contains ``pyproject.toml``).
        env: Optional run environment override (e.g. ``"staging"``). When
            ``None``, the project's default run environment is used.

    Returns:
        A fully populated ``ProjectSnapshot``.
    """
    return _build_project_snapshot(project_path=project_path, env=env)