Kedro-Viz
Kedro-Viz helps visualise Kedro data and analytics pipelines, offering a web-based UI to explore the structure and dependencies of projects. The current version is 12.3.0, and it follows a regular release cadence, typically with minor versions every 1-2 months addressing features, bug fixes, and compatibility with the Kedro framework.
Warnings
- breaking Kedro-Viz v12.2.0 dropped support for Python 3.9. Users on Python 3.9 or older must upgrade their Python version to 3.10 or newer.
- breaking Kedro-Viz v12.0.0 removed support for Kedro 0.x series. Projects using older Kedro versions will not be visualised correctly.
- breaking Kedro-Viz v11.0.0 removed the Experiment Tracking feature. Any workflows relying on this feature for visualization will no longer function.
- gotcha Running `kedro viz` outside a Kedro project directory or with an incompatible Kedro version can lead to errors or an empty visualization.
Install
-
pip install kedro-viz
Imports
- run_viz
from kedro_viz.server import run_viz
Quickstart
import os
from kedro.framework.session import KedroSession
from kedro.framework.startup import bootstrap_project
from kedro_viz.server import run_viz
# Simulate a minimal Kedro project structure for quickstart
project_path = './my_kedro_project'
if not os.path.exists(project_path):
os.makedirs(os.path.join(project_path, 'src', 'my_kedro_project', 'pipelines', 'data_processing'))
with open(os.path.join(project_path, 'pyproject.toml'), 'w') as f:
f.write('[tool.kedro]\npackage_name = "my_kedro_project"')
with open(os.path.join(project_path, 'src', 'my_kedro_project', 'pipeline_registry.py'), 'w') as f:
f.write("""
from kedro.pipeline import Pipeline, node
def create_pipeline(**kwargs):
return Pipeline([
node(lambda x: x + 1, 'input_data', 'intermediate_data', name='add_one_node'),
node(lambda x: x * 2, 'intermediate_data', 'output_data', name='multiply_two_node')
])
def register_pipelines():
return {
"__default__": create_pipeline()
}
""")
with open(os.path.join(project_path, 'src', 'my_kedro_project', '__init__.py'), 'w') as f:
f.write('')
# Bootstrap the Kedro project
os.chdir(project_path)
bootstrap_project(project_path)
# Run Kedro-Viz programmatically (this will open in your browser)
print(f"Running Kedro-Viz for project at {project_path}. Access it in your browser, typically at http://127.0.0.1:4141")
run_viz(project_path=project_path, port=4141, autoreload=False)