Skip to main content

Kedro-Viz helps visualise Kedro data and analytics pipelines

Project description

Kedro-Viz


Kedro-Viz Pipeline Visualisation

Data Science Pipelines. Beautifully Designed
Live Demo: https://demo.kedro.org/


CircleCI npm version Python Version PyPI version License DOI code style: prettier

Introduction

Kedro-Viz is an interactive development tool for building data science pipelines with Kedro. Kedro-Viz also allows users to view and compare different runs in the Kedro project.

Features

  • ✨ Complete visualisation of a Kedro project and its pipelines
  • 🎨 Supports light & dark themes out of the box
  • 🚀 Scales to big pipelines with hundreds of nodes
  • 🔎 Highly interactive, filterable and searchable
  • 🔬 Focus mode for modular pipeline visualisation
  • 📊 Rich metadata side panel to display parameters, plots, etc.
  • 📊 Supports all types of Plotly charts
  • ♻️ Autoreload on code change
  • 🧪 Supports tracking and comparing runs in a Kedro project
  • 🎩 Many more to come

Installation

There are two ways you can use Kedro-Viz:

  • As a Kedro plugin (the most common way).

    To install Kedro-Viz as a Kedro plugin:

    pip install kedro-viz
    
  • As a standalone React component (for embedding Kedro-Viz in your web application).

    To install the standalone React component:

    npm install @quantumblack/kedro-viz
    

Usage

CLI Usage

To launch Kedro-Viz from the command line as a Kedro plugin, use the following command from the root folder of your Kedro project:

kedro viz

A browser tab opens automatically to serve the visualisation at http://127.0.0.1:4141/.

Kedro-Viz also supports the following additional arguments on the command line:

Usage: kedro viz [OPTIONS]

  Visualise a Kedro pipeline using Kedro-Viz.

Options:
  --host TEXT               Host that viz will listen to. Defaults to
                            localhost.

  --port INTEGER            TCP port that viz will listen to. Defaults to
                            4141.

  --browser / --no-browser  Whether to open viz interface in the default
                            browser or not. Browser will only be opened if
                            host is localhost. Defaults to True.

  --load-file FILE          Path to load the pipeline JSON file
  --save-file FILE          Path to save the pipeline JSON file
  --pipeline TEXT           Name of the registered pipeline to visualise. If not
                            set, the default pipeline is visualised

  -e, --env TEXT            Kedro configuration environment. If not specified,
                            catalog config in `local` will be used

  --autoreload              Autoreload viz server when a Python or YAML file change in
                            the Kedro project

  -h, --help                Show this message and exit.

Experiment Tracking usage

To enable experiment tracking in Kedro-Viz, you need to add the Kedro-Viz SQLiteStore to your Kedro project.

This can be done by adding the below code to settings.py in the src folder of your Kedro project.

from kedro_viz.integrations.kedro.sqlite_store import SQLiteStore
from pathlib import Path
SESSION_STORE_CLASS = SQLiteStore
SESSION_STORE_ARGS = {"path": str(Path(__file__).parents[2] / "data")}

Once the above set-up is complete, tracking datasets can be used to track relevant data for Kedro runs. More information on how to use tracking datasets can be found here

Notes:

  • Experiment Tracking is only available for Kedro-Viz >= 4.0.2 and Kedro >= 0.17.5
  • Prior to Kedro 0.17.6, when using tracking datasets, you will have to explicitly mark the datasets as versioned for it to show up properly in Kedro-Viz experiment tracking tab. From Kedro >= 0.17.6, this is done automatically:
train_evaluation.r2_score_linear_regression:
  type: tracking.MetricsDataSet
  filepath: ${base_location}/09_tracking/linear_score.json
  versioned: true

Standalone React component usage

To use Kedro-Viz as a standalone React component, import the component and supply a data JSON as prop:

import KedroViz from '@quantumblack/kedro-viz';

const MyApp = () => (
  <div style={{ height: '100vh' }}>
    <KedroViz data={json} />
  </div>
);

The JSON can be obtained by running:

kedro viz --save-file=filename.json

We also recommend wrapping the Kedro-Viz component with a parent HTML/JSX element that has a specified height (as seen in the above example) in order for Kedro-Viz to be styled properly.

Feature Flags

Kedro-Viz uses features flags to roll out some experimental features. The following flags are currently in use:

Flag Description
sizewarning From release v3.9.1. Show a warning before rendering very large graphs (default true)
expandAllPipelines From release v4.3.2. Expand all modular pipelines on first load (default false)

To enable or disable a flag, click on the settings icon in the toolbar and toggle the flag on/off.

Kedro-Viz also logs a message in your browser's developer console to show the available flags and their values as currently set on your machine.

Maintainers

Kedro-Viz is maintained by the kedro team and a number of contributors from across the world.

Contribution

If you want to contribute to Kedro-Viz, please check out our contributing guide.

License

Kedro-Viz is licensed under the Apache 2.0 License.

Citation

If you're an academic, Kedro-Viz can also help you, for example, as a tool to visualise how your publication's pipeline is structured. Find our citation reference on Zenodo.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kedro-viz-4.6.0.tar.gz (6.4 MB view details)

Uploaded Source

Built Distributions

kedro_viz-4.6.0-py3.8.egg (6.6 MB view details)

Uploaded Source

kedro_viz-4.6.0-py3-none-any.whl (6.5 MB view details)

Uploaded Python 3

File details

Details for the file kedro-viz-4.6.0.tar.gz.

File metadata

  • Download URL: kedro-viz-4.6.0.tar.gz
  • Upload date:
  • Size: 6.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.13

File hashes

Hashes for kedro-viz-4.6.0.tar.gz
Algorithm Hash digest
SHA256 4b4b2dc2b833ddc4c984b2abfe758f662a96c13b387b1649ed48e52d444321db
MD5 5980eac9cac72da5846a441523d98840
BLAKE2b-256 89964a14bbd20824dbced7734cfab1a6867c77785bec6265fd32b3f01634f138

See more details on using hashes here.

File details

Details for the file kedro_viz-4.6.0-py3.8.egg.

File metadata

  • Download URL: kedro_viz-4.6.0-py3.8.egg
  • Upload date:
  • Size: 6.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.13

File hashes

Hashes for kedro_viz-4.6.0-py3.8.egg
Algorithm Hash digest
SHA256 e16ba4cb706e3e258f5e090ba07389f5425bd11b83f756e98e9c108de4c226ac
MD5 b6fd0142fd85aca98e56240cf23b0560
BLAKE2b-256 b41980fb7d588ab8c248caac7564351646fd2b438a9a4a02b85e7916a14176b9

See more details on using hashes here.

File details

Details for the file kedro_viz-4.6.0-py3-none-any.whl.

File metadata

  • Download URL: kedro_viz-4.6.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.13

File hashes

Hashes for kedro_viz-4.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8873bbda494ebfa57053d2c58bf13b8a0c76baecd7a67f62d76b84e8d6fdc00
MD5 d63c7697cd41f443b230f1dd82e95938
BLAKE2b-256 cabae51df261ef68152991c0e6e7a08ab24452bf82c72b60237393a6cf31b5a2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page