### Clone and Run Standalone Kedro-Viz Example
Source: https://github.com/kedro-org/kedro-viz/blob/main/README.npm.md
Clone the kedro-viz-standalone repository, install dependencies, and start the example React application to use Kedro-Viz in standalone or embedded mode.
```bash
git clone https://github.com/kedro-org/kedro-viz-standalone.git
cd kedro-viz-standalone
npm install
npm start
```
--------------------------------
### Install Project Requirements
Source: https://github.com/kedro-org/kedro-viz/blob/main/demo-project/README.md
Install the specific dependencies for the demo project.
```bash
pip install -r src/demo_project/requirements.in
```
--------------------------------
### Install Dependencies for Kedro-Viz
Source: https://github.com/kedro-org/kedro-viz/blob/main/CONTRIBUTING.md
Run this command after cloning the repository to download and install all necessary project dependencies.
```bash
npm install
```
--------------------------------
### Start Kedro-Viz Development Server
Source: https://github.com/kedro-org/kedro-viz/blob/main/CONTRIBUTING.md
Starts the development server which serves the app locally and watches for file changes. It also updates the compiled JavaScript in the /lib directory.
```bash
npm start
```
--------------------------------
### Start Kedro-Viz in Lite Mode
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/kedro-viz_visualisation.md
Use the experimental --lite flag to visualise pipelines without installing project dependencies. Note that this mode has limited functionality and may show warnings for missing dependencies.
```bash
kedro viz run --lite
```
--------------------------------
### Install Kedro-Viz as Kedro Plugin
Source: https://github.com/kedro-org/kedro-viz/blob/main/README.md
Use this command to install Kedro-Viz as a plugin for your Kedro project. This is the most common installation method.
```bash
pip install kedro-viz
```
--------------------------------
### Install Kedro-Viz and Demo Project Dependencies
Source: https://github.com/kedro-org/kedro-viz/blob/main/CONTRIBUTING.md
Installs necessary dependencies for Kedro-Viz and the demo project. Ensure you have Python 3.10+ installed.
```bash
pip3 install -r package/test_requirements.txt -r demo-project/src/docker_requirements.txt
```
--------------------------------
### Example: Complete Theme-Aware Configuration
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/customise_node_styling.md
Configure different styles for light and dark themes for multiple nodes to ensure consistent appearance across modes.
```json
{
"data_processing.clean_data": {
"fill": "#4ecdc4",
"themes": {
"light": {
"fill": "#e8f5e8",
"stroke": "#4caf50",
"color": "#2e7d32"
},
"dark": {
"fill": "#1b5e20",
"stroke": "#4caf50",
"color": "#c8e6c9"
}
}
},
"model_training.train_classifier": {
"fill": "#4ecdc4",
"themes": {
"light": {
"fill": "#e3f2fd",
"stroke": "#2196f3",
"color": "#0d47a1"
},
"dark": {
"fill": "#0d47a1",
"stroke": "#2196f3",
"color": "#bbdefb"
}
}
}
}
```
--------------------------------
### Run Documentation Locally
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/readme.md
Starts the MkDocs development server to view the documentation locally. Access it via http://127.0.0.1:8000/pages/.
```bash
mkdocs serve
```
--------------------------------
### Install Documentation Dependencies
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/readme.md
Installs all required packages for building and serving the documentation locally. Ensure you have an active Conda environment.
```bash
pip install -e ".[docs]"
```
--------------------------------
### Start Kedro-Viz
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/kedro-viz_visualisation.md
Launch Kedro-Viz from your project directory to visualise your pipeline. This command opens a browser tab at http://127.0.0.1:4141/.
```bash
kedro viz run
```
```bash
kedro viz
```
--------------------------------
### Install Kedro-Viz with GCP Dependencies
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/publish_and_share_kedro_viz_on_gcp.md
Install Kedro-Viz with the necessary dependencies for Google Cloud Platform integration.
```bash
pip install 'kedro-viz[gcp]'
```
--------------------------------
### Install Kedro-Viz with AWS Support
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/publish_and_share_kedro_viz_on_aws.md
Install the Kedro-Viz package with the necessary dependencies for AWS integration.
```bash
pip install 'kedro-viz[aws]'
```
--------------------------------
### Build Kedro-Viz Application
Source: https://github.com/kedro-org/kedro-viz/blob/main/CONTRIBUTING.md
Builds the Kedro-Viz application. This command should be run once during initial setup.
```bash
make build
```
--------------------------------
### Complete catalog.yml with Layer Definitions
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/kedro-viz_visualisation.md
An example of a `catalog.yml` file demonstrating how to define layers for various datasets using the `metadata.kedro-viz.layer` key.
```yaml
companies:
type: pandas.CSVDataset
filepath: data/01_raw/companies.csv
metadata:
kedro-viz:
layer: raw
reviews:
type: pandas.CSVDataset
filepath: data/01_raw/reviews.csv
metadata:
kedro-viz:
layer: raw
shuttles:
type: pandas.ExcelDataset
filepath: data/01_raw/shuttles.xlsx
metadata:
kedro-viz:
layer: raw
preprocessed_companies:
type: pandas.ParquetDataset
filepath: data/02_intermediate/preprocessed_companies.pq
metadata:
kedro-viz:
layer: intermediate
preprocessed_shuttles:
type: pandas.ParquetDataset
filepath: data/02_intermediate/preprocessed_shuttles.pq
metadata:
kedro-viz:
layer: intermediate
model_input_table:
type: pandas.ParquetDataset
filepath: data/03_primary/model_input_table.pq
metadata:
kedro-viz:
layer: primary
regressor:
type: pickle.PickleDataset
filepath: data/06_models/regressor.pickle
versioned: true
metadata:
kedro-viz:
layer: models
```
--------------------------------
### Install Kedro
Source: https://github.com/kedro-org/kedro-viz/blob/main/demo-project/README.md
Install Kedro version 0.18.0 or compatible.
```bash
pip install kedro~=0.18.0
```
--------------------------------
### Serve Kedro-Viz Locally with Node http-server
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/platform_agnostic_sharing_with_kedro_viz.md
Install the `http-server` Node.js package globally and then run it from the `build` directory to serve the Kedro-Viz application locally.
```bash
npm install -g http-server
```
```bash
http-server
```
--------------------------------
### Serve Kedro-Viz Locally with Python HTTP Server
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/platform_agnostic_sharing_with_kedro_viz.md
Navigate to the `build` directory and use Python's built-in HTTP server to view the `index.html` locally. This starts a web server at `http://localhost:8000`.
```bash
python -m http.server
```
--------------------------------
### Install Project Dependencies
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/platform_agnostic_sharing_with_kedro_viz.md
Install the Python dependencies required for the Kedro project from the `requirements.txt` file.
```bash
pip install -r requirements.txt
```
--------------------------------
### Install Kedro-Viz Azure Dependencies
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/publish_and_share_kedro_viz_on_azure.md
Installs the Kedro-Viz package with Azure support. This command should be run in your terminal.
```bash
pip install 'kedro-viz[azure]'
```
--------------------------------
### Note Component Example
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/readme.md
Demonstrates the syntax for a note block in the documentation. Use this to highlight important information.
```markdown
> **Note**
> This is a note block to highlight important information.
```
```markdown
> This is a note block to highlight important information.
```
--------------------------------
### Launch Kedro-Viz Development Server
Source: https://github.com/kedro-org/kedro-viz/blob/main/CONTRIBUTING.md
Launches the Kedro-Viz backend development server. This command starts the server at localhost:4142 and serves data from the demo project.
```bash
make run
```
--------------------------------
### Code Block Component Example
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/readme.md
Shows how to render a Python code block within the documentation. This is useful for displaying code examples.
```python
def hello_world():
print("Hello, world!")
```
```python
def hello_world():
print("Hello, world!")
```
--------------------------------
### Example: Basic Node Styling
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/customise_node_styling.md
Apply distinct background, border, and text colors to different nodes in your pipeline.
```json
{
"data_processing.preprocessing_node": {
"fill": "#4ecdc4",
"stroke": "#26d0ce",
"color": "#ffffff"
},
"data_science.train_model": {
"fill": "#45b7d1",
"stroke": "#3a9bc1",
"color": "#ffffff"
},
"reporting.create_visualization": {
"fill": "#f9ca24",
"stroke": "#f0932b",
"color": "#2f3542"
}
}
```
--------------------------------
### Deploy Kedro-Viz with Dataset Previews (CLI)
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/publish_and_share_kedro_viz_on_aws.md
Starting from Kedro-Viz 9.2.0, use the `--include-previews` flag to enable dataset previews during deployment via the CLI.
```bash
kedro viz deploy --platform=aws --endpoint=[s3-endpoint] --bucket-name=[s3-bucket-name] --include-previews
```
--------------------------------
### Type Hinting Example
Source: https://github.com/kedro-org/kedro-viz/blob/main/CONTRIBUTING.md
Demonstrates the use of PEP 484 type hints for user-facing functions and class methods.
```python
def count_truthy(elements: List[Any]) -> int:
return sum(1 for elem in elements if elem)
```
--------------------------------
### Install Python Test Requirements
Source: https://github.com/kedro-org/kedro-viz/blob/main/CONTRIBUTING.md
Installs the necessary Python dependencies for running tests. This should be done before executing any Python testing commands.
```bash
pip install -r test_requirements.txt
```
--------------------------------
### Setup and Test Kedro-Viz Package Import
Source: https://github.com/kedro-org/kedro-viz/blob/main/CONTRIBUTING.md
Automates the process of packaging Kedro-Viz, copying it to a test React app, and running Jest tests. This verifies the package's behavior when imported.
```bash
npm run lib-test:setup
cd tools/test-lib/react-app
npm test
```
--------------------------------
### Configure Kedro-Viz Display Options
Source: https://github.com/kedro-org/kedro-viz/blob/main/README.npm.md
Use the `options` prop to control the visibility of various UI elements like buttons, navigation, and panels. This example shows how to enable expand pipelines, export, global navigation, labels, layers, metadata panel, minimap, sidebar, and zoom toolbar.
```javascript
```
--------------------------------
### Enable Dataset Previews
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/publish_and_share_kedro_viz_on_azure.md
Starting from Kedro-Viz 9.2.0, dataset previews are not included by default. Use the `--include-previews` flag to enable them for all datasets.
```bash
kedro viz deploy --platform=azure --endpoint=[azure-endpoint] --bucket-name=[azure-bucket-name] --include-previews
```
--------------------------------
### Remove Kedro-Viz Session Store Setup
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/migrate_experiment_tracking.md
Remove the session store configuration from `settings.py` when migrating away from Kedro-Viz experiment tracking.
```python
from kedro_viz.integrations.kedro.sqlite_store import SQLiteStore
SESSION_STORE_CLASS = SQLiteStore
SESSION_STORE_ARGS = {"path": str(Path(__file__).parents[2] / "data")}
```
--------------------------------
### Original Modular Pipelines with Cycle
Source: https://github.com/kedro-org/kedro-viz/blob/main/package/kedro_viz/docs/technical_design_expand_collapse_modular_pipelines.md
This diagram shows an example of a cyclic dependency among modular pipelines before cycle removal. It depicts a scenario where 'QB.Product' and 'QB.Client' are collapsed into 'QB', creating a cycle with 'Contractor'.
```text
++++++++++++++
+ QB.Product +
++++++++++++++
|
v
++++++++++++++
+ Contractor +
++++++++++++++
|
v
++++++++++++++
+ QB.Client +
++++++++++++++
```
--------------------------------
### Create Kedro Spaceflights Project
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/platform_agnostic_sharing_with_kedro_viz.md
Use the Kedro starter to generate the spaceflights tutorial project with all necessary code.
```bash
kedro new --starter=spaceflights-pandas
```
--------------------------------
### Launch Kedro-Viz Server with Custom Project Path
Source: https://github.com/kedro-org/kedro-viz/blob/main/CONTRIBUTING.md
Launches the Kedro-Viz backend development server, pointing to a different Kedro project. Replace `/new-kedro-project` with the actual path.
```bash
make run PROJECT_PATH=/new-kedro-project
```
--------------------------------
### Run Kedro-Viz
Source: https://github.com/kedro-org/kedro-viz/blob/main/README.md
Launches Kedro-Viz to serve the visualization. A browser tab opens automatically. Supports arguments for host, port, browser opening, loading/saving data, pipeline selection, environment, autoreload, hooks, parameters, and a lite mode.
```bash
kedro viz run
```
```bash
Usage: kedro viz run [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 Kedro-Viz data from a directory
--save-file FILE Path to save Kedro-Viz data to a directory
-p, --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
--include-hooks A flag to include all registered hooks in your
Kedro Project
--params TEXT Specify extra parameters that you want to pass to
the context initializer. Items must be separated
by comma, keys - by colon, example:
param1:value1,param2:value2. Each parameter is
split by the first comma, so parameter values are
allowed to contain colons, parameter keys are not.
To pass a nested dictionary as parameter, separate
keys by '.', example: param_group.param1:value1.
--lite An experimental flag to open Kedro-Viz without Kedro
project dependencies.
-h, --help Show this message and exit.
```
--------------------------------
### Build Kedro-Viz for Static Hosting
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/platform_agnostic_sharing_with_kedro_viz.md
Generate a static Kedro-Viz app package in the `build` folder for deployment on static website hosting platforms.
```bash
kedro viz build
```
--------------------------------
### Install Kedro-Viz as Standalone React Component
Source: https://github.com/kedro-org/kedro-viz/blob/main/README.md
Install the standalone React component if you intend to embed Kedro-Viz within your own web application. This method is suitable for custom integrations.
```bash
npm install @quantumblack/kedro-viz
```
--------------------------------
### Build Kedro Viz for Hosting
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/cli-docs.md
Creates a build directory containing the static visualization data for your Kedro pipeline. This build can then be hosted on various platforms. Use `--include-previews` to include dataset previews in the build.
```bash
kedro viz build --include-previews
```
--------------------------------
### Build Kedro-Viz Directory
Source: https://github.com/kedro-org/kedro-viz/blob/main/README.md
Creates a build directory of the local Kedro-Viz instance with static data from the Kedro project. Supports including hooks and dataset previews.
```bash
kedro viz build
```
```bash
Usage: kedro viz build [OPTIONS]
Create build directory of local Kedro Viz instance with Kedro project data
Options:
--include-hooks A flag to include all registered hooks in your Kedro
Project
--include-previews A flag to include preview for all the datasets
-h, --help Show this message and exit.
```
--------------------------------
### Load Kedro-Viz Pipeline Visualization
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/kedro-viz_visualisation.md
Use the `kedro viz run --load-file` command to load and visualize a previously saved Kedro-Viz pipeline structure from a specified folder.
```bash
kedro viz run --load-file=my_shareable_pipeline
```
--------------------------------
### Run JavaScript End-to-End Tests
Source: https://github.com/kedro-org/kedro-viz/blob/main/CONTRIBUTING.md
Executes JavaScript end-to-end tests using Cypress. All Kedro-Viz dependencies must be installed prior to running this command.
```bash
npm run cy:test
```
--------------------------------
### Run Kedro Viz
Source: https://github.com/kedro-org/kedro-viz/blob/main/demo-project/README.md
Launch the Kedro visualization tool to explore the data pipeline.
```bash
kedro viz run
```
--------------------------------
### Run JavaScript Unit and Component Tests
Source: https://github.com/kedro-org/kedro-viz/blob/main/CONTRIBUTING.md
Executes JavaScript unit and component tests using Jest and React Testing Library. Ensure all dependencies are installed.
```bash
npm test
```
--------------------------------
### Run Kedro-Viz with Custom Arguments
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/kedro-viz_visualisation.md
Launch Kedro Viz with custom arguments to specify the host, port, and enable autoreload for automatic updates. This allows for a more tailored visualization experience.
```ipython
%run_viz --host=127.0.0.1 --port=4141 --autoreload
```
--------------------------------
### Run Cypress in Head Mode
Source: https://github.com/kedro-org/kedro-viz/blob/main/CONTRIBUTING.md
Starts Cypress in head mode for active development of end-to-end tests. Ensure both frontend and backend applications are running separately before executing.
```bash
npm run cy:dev
```
--------------------------------
### Kedro Viz Build Options
Source: https://github.com/kedro-org/kedro-viz/blob/main/package/README.md
Options for building the Kedro-Viz directory, including flags to include hooks and dataset previews.
```bash
Usage: kedro viz build [OPTIONS]
Create build directory of local Kedro Viz instance with Kedro project data
Options:
--include-hooks A flag to include all registered hooks in your Kedro
Project
--include-previews A flag to include preview for all the datasets
-h, --help Show this message and exit.
```
--------------------------------
### Configure NotebookVisualizer with Options
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/kedro-viz_visualisation.md
Instantiate `NotebookVisualizer` with a pipeline and customize its appearance and behavior using the `options` dictionary. This allows fine-grained control over the visualization's display elements and themes.
```python
NotebookVisualizer(
pipeline=your_pipeline_instance,
catalog=optional_data_catalog_instance,
options={
"display": {
"expandPipelinesBtn": False,
"exportBtn": False,
"labelBtn": False,
"layerBtn": False,
"metadataPanel": False,
"miniMap": False,
"sidebar": False,
"zoomToolbar": False,
},
"expandAllPipelines": False,
"behaviour": {
"reFocus": False,
},
"theme": "dark",
"width": "100%",
"height": "600px",
},
js_url="optional_url_for_viz_bundle",
css_url="optional_url_for_css_bundle"
)
```
--------------------------------
### Start Kedro-Viz with Autoreload
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/kedro-viz_visualisation.md
Enable automatic reloading of Kedro-Viz when Python or YAML files change in your project. This flag helps reflect project changes in the visualisation as they happen.
```bash
kedro viz run --autoreload
```
--------------------------------
### Deploy Kedro-Viz to Azure
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/publish_and_share_kedro_viz_on_azure.md
Execute this command from your project's root folder to deploy Kedro-Viz to Azure. Replace `[azure-endpoint]` and `[azure-bucket-name]` with your specific Azure details.
```bash
kedro viz deploy --platform=azure --endpoint=[azure-endpoint] --bucket-name=[azure-bucket-name]
```
--------------------------------
### Example Git Commit Message Structure
Source: https://github.com/kedro-org/kedro-viz/blob/main/STYLE_GUIDE.md
Follow this template for writing clear and informative Git commit messages. Ensure the subject is concise and the body provides necessary details. Use imperative mood for commit subjects.
```git
Capitalized, short (50 chars or less) summary
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase can get confused if you run the
two together.
Write your commit message in the imperative: "Fix bug" and not "Fixed bug"
or "Fixes bug." This convention matches up with commit messages generated
by commands like git merge and git revert.
Further paragraphs come after blank lines.
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, followed by a
single space, with blank lines in between, but conventions vary here
- Use a hanging indent
If you use an issue tracker, add a reference(s) to them at the bottom,
like so:
Resolves: #123
```
--------------------------------
### Kedro Viz Run Options
Source: https://github.com/kedro-org/kedro-viz/blob/main/package/README.md
Provides options for configuring the Kedro-Viz server, including host, port, browser behavior, data loading/saving, pipeline selection, environment, autoreload, hooks, parameters, and a lite mode.
```bash
Usage: kedro viz run [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 Kedro-Viz data from a directory
--save-file FILE Path to save Kedro-Viz data to a directory
-p, --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
--include-hooks A flag to include all registered hooks in your
Kedro Project
--params TEXT Specify extra parameters that you want to pass to
the context initializer. Items must be separated
by comma, keys - by colon, example:
param1:value1,param2:value2. Each parameter is
split by the first comma, so parameter values are
allowed to contain colons, parameter keys are not.
To pass a nested dictionary as parameter, separate
keys by '.', example: param_group.param1:value1.
--lite An experimental flag to open Kedro-Viz without Kedro
project dependencies.
-h, --help Show this message and exit.
```
--------------------------------
### Publish Kedro-Viz Project via CLI
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/publish_and_share_kedro_viz_on_gcp.md
Deploy your Kedro-Viz project to GCP using the command-line interface. Specify the platform, endpoint, and bucket name. Use `--include-previews` to enable dataset previews.
```bash
kedro viz deploy --platform=gcp --endpoint=[gcp-endpoint] --bucket-name=[gcp-bucket-name]
```
--------------------------------
### Kedro Viz Deploy Options
Source: https://github.com/kedro-org/kedro-viz/blob/main/package/README.md
Options for deploying Kedro-Viz, including cloud platform, static website endpoint, bucket name, and flags for including hooks and previews.
```bash
Usage: kedro viz deploy [OPTIONS]
Deploy and host Kedro Viz on AWS S3.
Options:
--platform TEXT Supported Cloud Platforms like ('aws', 'azure', 'gcp')
to host Kedro Viz [required]
--endpoint TEXT Static Website hosted endpoint.(eg., For AWS - http://.s3-website..amazonaws.com/)
[required]
--bucket-name TEXT Bucket name where Kedro Viz will be hosted [required]
--include-hooks A flag to include all registered hooks in your Kedro
Project
--include-previews A flag to include preview for all the datasets
-h, --help Show this message and exit.
```
--------------------------------
### Run Kedro Viz Locally
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/cli-docs.md
Launches a local Kedro Viz instance to visualize a Kedro pipeline. Use this command to view your pipeline interactively in a browser. It defaults to the 'run' sub-command if no other sub-command is specified.
```bash
kedro viz
```
```bash
kedro viz run
```
--------------------------------
### Run Kedro Project
Source: https://github.com/kedro-org/kedro-viz/blob/main/demo-project/README.md
Execute the Kedro data pipeline.
```bash
kedro run
```
--------------------------------
### Run Kedro Viz with Specific Pipeline and Environment
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/cli-docs.md
Launches a local Kedro Viz instance, specifying a particular pipeline and Kedro configuration environment. This is useful for visualizing different pipeline configurations or environments.
```bash
kedro viz -p my_pipeline -e dev
```
```bash
kedro viz run -p my_pipeline -e dev
```
--------------------------------
### Deploy Kedro-Viz to AWS via CLI (Newer Versions)
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/publish_and_share_kedro_viz_on_aws.md
Use the `kedro viz deploy` command to publish your Kedro-Viz project to an AWS S3 bucket. Specify the platform, endpoint, and bucket name.
```bash
kedro viz deploy --platform=aws --endpoint=[s3-endpoint] --bucket-name=[s3-bucket-name]
```
--------------------------------
### Deploy Kedro-Viz
Source: https://github.com/kedro-org/kedro-viz/blob/main/README.md
Deploys and hosts Kedro-Viz on AWS S3. Requires specifying the platform, endpoint, and bucket name. Supports including hooks and dataset previews.
```bash
kedro viz deploy
```
```bash
Usage: kedro viz deploy [OPTIONS]
Deploy and host Kedro Viz on AWS S3.
Options:
--platform TEXT Supported Cloud Platforms like ('aws', 'azure', 'gcp')
to host Kedro Viz [required]
--endpoint TEXT Static Website hosted endpoint.(eg., For AWS - http://.s3-website..amazonaws.com/)
[required]
--bucket-name TEXT Bucket name where Kedro Viz will be hosted [required]
--include-hooks A flag to include all registered hooks in your Kedro
Project
--include-previews A flag to include preview for all the datasets
-h, --help Show this message and exit.
```
--------------------------------
### Visualize Pipeline with NotebookVisualizer
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/kedro-viz_visualisation.md
Instantiate and use the `NotebookVisualizer` class to visualize Kedro pipelines directly within a notebook. This method does not require a full Kedro project and is useful for pipeline exploration.
```python
from kedro.pipeline import pipeline, node
def dummy(ds1):
return ds1
n0 = node(dummy, 'flights', 'processed_flights')
dummy_pipe = pipeline([n0])
from kedro_viz.integrations.notebook import NotebookVisualizer
NotebookVisualizer(dummy_pipe).show()
```
--------------------------------
### Create Reporting Pipeline
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/preview_plotly_datasets.md
Generate a template for the reporting pipeline using the kedro CLI.
```bash
kedro pipeline create reporting
```
--------------------------------
### Deploy Kedro-Viz to AWS via CLI (Older Versions)
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/publish_and_share_kedro_viz_on_aws.md
For Kedro-Viz version 7.0.0, use this command to deploy to AWS, specifying the region and bucket name.
```bash
kedro viz deploy --region=[aws-bucket-region] --bucket-name=[s3-bucket-name]
```
--------------------------------
### Configure Data Catalog for Previews
Source: https://github.com/kedro-org/kedro-viz/blob/main/docs/preview_pandas_datasets.md
Define datasets in `catalog.yml` to enable previews in Kedro-Viz. Specify `pandas.CSVDataset` or `pandas.ExcelDataset` and optionally use `preview_args` to control the number of rows shown.
```yaml
companies:
type: pandas.CSVDataset
filepath: data/01_raw/companies.csv
reviews:
type: pandas.CSVDataset
filepath: data/01_raw/reviews.csv
metadata:
kedro-viz:
layer: raw
preview_args:
nrows: 10
shuttles:
type: pandas.ExcelDataset
filepath: data/01_raw/shuttles.xlsx
metadata:
kedro-viz:
layer: raw
preview_args:
nrows: 15
```