chartbook.cli#

Module Contents#

Functions#

build

Generate HTML documentation in the specified output directory.

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.

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.

API#

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

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.

  • warn_missing (bool) – If True, warn instead of error when source files are missing.

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.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