chartbook.cli#

Module Contents#

Functions#

browse

Open the project documentation in your default browser.

build

Generate HTML documentation in the specified output directory.

catalog

Manage the chartbook catalog.

catalog_add

Add pipeline directory(ies) to the catalog.

catalog_browse

Open the global catalog documentation in your default browser.

catalog_build

Build HTML documentation for the global catalog.

catalog_disable

Disable a pipeline in the catalog.

catalog_enable

Re-enable a previously disabled pipeline in the catalog.

catalog_init

Initialize the global catalog at ~/.chartbook/chartbook.toml.

config

Configure the default catalog path for data loading.

create_data_glimpses

Create a data glimpses report from dodo.py tasks.

data

Data operations (get paths, docs).

data_get_docs

Print documentation content for a dataframe.

data_get_docs_path

Get the path to a dataframe’s documentation source.

data_get_path

Get the path to a dataframe’s parquet file.

init

Initialize a new chartbook project from the cookiecutter template.

install

Install bundled resources into the current project.

install_skill

Install the bundled Claude Code skill.

ls

List catalog objects (pipelines, dataframes, charts).

ls_charts

List all charts across pipelines.

ls_dataframes

List all dataframes across pipelines.

ls_pipelines

List all pipelines.

main

chartbook CLI tool for generating documentation websites.

publish

Publish the documentation to the specified output directory.

resolve_project_dir

Resolve the project directory to an absolute path.

Data#

API#

chartbook.cli.VERSION_STAMP_NAME#

‘.chartbook-skill-version’

chartbook.cli.browse(output_dir, project_dir)#

Open the project documentation in your default browser.

Looks for index.html in the OUTPUT_DIR (default: ./docs) and opens it using the system’s default web browser. Works on macOS, Windows, and Linux.

Examples: chartbook browse chartbook browse ./my-docs chartbook browse –project-dir /path/to/project

chartbook.cli.build(output_dir, project_dir, publish_dir, docs_build_dir, temp_docs_src_dir, keep_build_dirs, force_write, size_threshold, strict, strip_mathjax2)#

Generate HTML documentation in the specified output directory.

Parameters:
  • output_dir (str) – Directory where output will be generated.

  • project_dir (str) – Root directory of the project.

  • publish_dir (str) – Directory where files will be published.

  • docs_build_dir (str) – Directory where documentation will be built.

  • temp_docs_src_dir (str) – Temporary directory for documentation source files.

  • keep_build_dirs (bool) – If True, keeps temporary build directory after generation.

  • force_write (bool) – If True, overwrites existing output directory.

  • size_threshold (float) – File size threshold in MB above which to use memory-efficient loading.

  • strict (bool) – If True, error and exit on missing source files.

  • strip_mathjax2 (bool) – If True, strip Plotly’s MathJax 2 scripts from notebook outputs.

chartbook.cli.catalog()#

Manage the chartbook catalog.

chartbook.cli.catalog_add(paths, catalog_path, yes)#

Add pipeline directory(ies) to the catalog.

PATHS can be one or more directories containing a chartbook.toml file, or glob patterns that expand to such directories.

Examples::

chartbook catalog add /path/to/pipeline
chartbook catalog add /path/to/parent/*
chartbook catalog add /path/to/parent/* -y
chartbook catalog add ./proj1 ./proj2 ./proj3
chartbook.cli.catalog_browse()#

Open the global catalog documentation in your default browser.

chartbook.cli.catalog_build(force_write, strict)#

Build HTML documentation for the global catalog.

Uses the catalog path from ~/.chartbook/settings.toml if configured, otherwise falls back to ~/.chartbook/chartbook.toml.

chartbook.cli.catalog_disable(pipeline_id, catalog_path)#

Disable a pipeline in the catalog.

The pipeline entry is kept but skipped during builds. Re-enable with chartbook catalog enable.

chartbook.cli.catalog_enable(pipeline_id, catalog_path)#

Re-enable a previously disabled pipeline in the catalog.

chartbook.cli.catalog_init(title)#

Initialize the global catalog at ~/.chartbook/chartbook.toml.

Creates a minimal catalog with an empty pipelines section. Use chartbook catalog add to add pipelines afterwards.

chartbook.cli.config()#

Configure the default catalog path for data loading.

Sets the path to a catalog’s chartbook.toml in ~/.chartbook/settings.toml so that data.load() can find pipelines without an explicit catalog_path argument.

chartbook.cli.create_data_glimpses(no_samples, no_stats, output_dir, size_threshold)#

Create a data glimpses report from dodo.py tasks.

This command parses the dodo.py file in the current directory to find all CSV/Parquet files and creates a comprehensive data glimpse report in Markdown format.

Parameters:
  • no_samples (bool) – If True, exclude sample values sections from the report.

  • no_stats (bool) – If True, exclude numeric column statistics sections from the report.

  • output_dir (str, optional) – Directory to save the output file.

  • size_threshold (float) – File size threshold in MB above which to use memory-efficient loading.

Example usage: chartbook create-data-glimpses chartbook create-data-glimpses –no-samples chartbook create-data-glimpses –no-samples –no-stats chartbook create-data-glimpses -o ./docs/ chartbook create-data-glimpses –size-threshold 100

chartbook.cli.data()#

Data operations (get paths, docs).

chartbook.cli.data_get_docs(pipeline, dataframe, catalog)#

Print documentation content for a dataframe.

Examples: chartbook data get-docs –pipeline yield_curve –dataframe repo_public

chartbook.cli.data_get_docs_path(pipeline, dataframe, catalog)#

Get the path to a dataframe’s documentation source.

Examples: chartbook data get-docs-path –pipeline yield_curve –dataframe repo_public

chartbook.cli.data_get_path(pipeline, dataframe, catalog)#

Get the path to a dataframe’s parquet file.

Examples: chartbook data get-path –pipeline yield_curve –dataframe repo_public

chartbook.cli.init()#

Initialize a new chartbook project from the cookiecutter template.

chartbook.cli.install()#

Install bundled resources into the current project.

chartbook.cli.install_skill(force, project)#

Install the bundled Claude Code skill.

By default the skill is installed user-level — into ~/.claude/skills/chartbook/, or $CLAUDE_CONFIG_DIR/skills/chartbook/ when that variable is set — so it is available in every Claude Code session. With --project it is installed into ./.claude/skills/chartbook/ in the current directory instead.

The command is idempotent: if the installed files already match the bundled skill, nothing is rewritten. Files from older skill layouts are removed so the installed copy exactly mirrors the bundled one, and the installing chartbook version is recorded alongside the skill files.

Parameters:
  • force (bool) – If True, overwrite existing files without prompting.

  • project (bool) – If True, install into the current directory’s .claude/ instead of the user-level skills directory.

chartbook.cli.ls(ctx, catalog)#

List catalog objects (pipelines, dataframes, charts).

Without a subcommand, lists all objects in a tree format. Use subcommands to list specific object types.

Examples: chartbook ls chartbook ls pipelines chartbook ls dataframes chartbook ls charts

chartbook.cli.ls_charts(ctx)#

List all charts across pipelines.

chartbook.cli.ls_dataframes(ctx)#

List all dataframes across pipelines.

chartbook.cli.ls_pipelines(ctx)#

List all pipelines.

chartbook.cli.main()#

chartbook CLI tool for generating documentation websites.

chartbook.cli.publish(publish_dir: pathlib.Path | str | None, project_dir: pathlib.Path | str, verbose: bool)#

Publish the documentation to the specified output directory.

If no publish directory is provided, a default local directory will be used.

Parameters:
  • publish_dir (Path or str, optional) – Directory where files will be published.

  • project_dir (Path or str) – Root directory of the project.

  • verbose (bool) – If True, enables verbose output.

chartbook.cli.resolve_project_dir(project_dir: pathlib.Path | None)[source]#

Resolve the project directory to an absolute path.

Parameters:

project_dir (Path, optional) – The project directory path, or None to use cwd.

Returns:

The resolved absolute path to the project directory.

Return type:

Path