Skip to main content

chartcoach

The chartcoach Python package opens a Guideline Catalog from local files or a published release. It provides guideline entries plus Polars and DuckDB tables for sections, labels, and references.

chartcoach is alpha software. Installing the package also installs the chartcoach CLI.

Read one guideline

uv add chartcoach
from chartcoach import open_catalog

catalog = open_catalog()
record = catalog.read(
    ids=["directly-label-series-instead-of-using-a-color-key"],
    source_detail="minimal",
)[0]
print(record["title"])

Expected output:

Directly label colored series instead of relying on a color key

This call downloads the catalog files over HTTPS, verifies the byte counts and SHA-256 hashes listed by the release, and caches the verified files.

Choose a catalog location

open_catalog(location) accepts:

Location Behavior
Authored folder Reads MANIFEST.md and entries/<id>/guideline.md
Compiled bundle Reads MANIFEST.md and entries.parquet
Local deployed root Opens the release selected by its catalog.json
Local release directory Reads its release.json and verifies listed files
catalog.json path or URL Follows the currently selected release
release.json path or URL Keeps one release digest across calls
Omitted Opens the official selected catalog

Install chartcoach[cloud] for S3, GCS, or Azure locations.

Query catalog tables

catalog.to_frame() returns the six stored fields for each guideline. catalog.table(name) returns guidelines, sections, guideline_labels, references, guideline_references, or guideline_sources as a query-ready Polars dataframe. Tables are derived on first use and reused within the Catalog. Each call returns an independent dataframe handle that callers can transform or mutate while the cached tables stay unchanged. catalog.duckdb() registers those six catalog tables in an in-memory DuckDB connection owned by the caller. Reuse it for related queries and close it after use.

Search an index

Install chartcoach[index] to open a named LanceDB index stored with a catalog release. The following template requires a release that publishes the named profile:

from chartcoach import open_catalog

catalog = open_catalog("dist/release-indexed")
table = catalog.index("minilm-normalized")
hits = (
    table.search("direct labels", query_type="fts", fts_columns="text")
    .select(["id", "parent_id", "role", "_score"])
    .limit(5)
    .to_list()
)
ids = list(dict.fromkeys(hit["parent_id"] for hit in hits))
records = catalog.read(ids=ids)

catalog.index() returns the release's LanceDB documents table from a protected shared extraction. Pass a new directory=Path(...) for a caller-owned writable copy. A missing profile raises CatalogError and lists the available names. Profile IDs are flat lowercase release handles. Inspect catalog.describe(profile=...) for the embedding binding, dimensions, distance_metric, and python_requirements. Explicit full-text search keeps embedding providers idle. Project the fields needed for candidate selection, then read the parent entries' context and exceptions before applying their advice.

Compose verified release files

entries = catalog.artifact("entries.parquet")
with catalog.duckdb() as connection:
    rows = connection.read_parquet(str(entries)).select("id, title").limit(5).fetchall()

local = catalog.cache()
offline = open_catalog(local)

catalog.release.artifacts lists available files, including optional document and projection Parquet exports. artifact(path) verifies and caches the file before returning a local path. cache() materializes every release file into a directory that opens offline. Remote artifacts and digest-addressed descriptors use the per-user platformdirs cache. Selected catalogs refresh catalog.json on each open.

For S3, pass your descriptor URI and the storage client's options to open_catalog(location, storage_options=...) with chartcoach[cloud] installed. See Open and cache catalogs. Use native DuckDB connections and LanceDB tables for SQL, filtering, reranking, batch search, and exports. Index parent_id values identify guideline entries.

Use chartcoach from a code-mode agent

chartcoach follows the open Agent Plugins specification. The installed Python distribution carries its version-matched Agent Skills and Model Context Protocol server configuration. A code-mode agent can inspect those components and call the chartcoach Python API directly:

import chartcoach.agent as cc

help(cc)
catalog = cc.open_catalog()
candidates = catalog.query(contains="labels", limit=5)
selected_ids = candidates.get_column("id").head(3).to_list()
records = catalog.read(ids=selected_ids, source_detail="minimal")
citations = catalog.cite(ids=selected_ids)
core = cc.agent_plugin().skill("core")
print(core.source)

cc.agent_plugin() returns an agent_plugins.Plugin object. Use cc.agent_plugin().skill(name) for direct lookup and skill.file(path) for a checked packaged resource.

contains matches a contiguous phrase in the ID, title, or description. The core skill teaches query recovery, index and SQL selection, and compact results. Load the matching workflow skill for chart review, recommendation, discussion, or contribution.

The Agent Plugin also declares the packaged MCP stdio entry through cc.agent_plugin().mcp. Install chartcoach[mcp] in the agent client's Python environment before it starts that server. Agents can inspect the complete module workflow with help(cc).

marimo is one environment for code-mode agents. It discovers chartcoach.agent through the installed marimo.agent.capability entry point.

Documentation

Page Details
Python Catalog methods plus Polars, DuckDB, and LanceDB
Catalog CLI Terminal commands, JSON output, and exit codes
MCP server SQL and search tools for MCP clients
Curate and publish Authoring, build, publication, and public selection

chartcoach is licensed under Apache-2.0.

Release files for chartcoach 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chartcoach 0.3.2
File Size Uploaded
chartcoach-0.3.2.tar.gz 92.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chartcoach 0.3.2
File Interpreter ABI Platform
chartcoach-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 225.8 kB

Release files / chartcoach-0.3.2.tar.gz

Download URL chartcoach-0.3.2.tar.gz
Size 92.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9d513fd293aa31ba2737b2a072c4794391c46cd52709c315f3dab361bff35f31
BLAKE2b-256 checksum
How to use checksums
20c6ee09f5c02b4fb2f9d746285b0bbb8e548be3ed25389718e1da7108ec6909
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / chartcoach-0.3.2-py3-none-any.whl

Download URL chartcoach-0.3.2-py3-none-any.whl
Size 133.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa7925ba9458c5a501a60b03305a0bcdad3b96dcba3a0b422fb36be132a04ae0
BLAKE2b-256 checksum
How to use checksums
49d5f6c999343c976e2bc6c3efbd88b75f622826fc2d19c59b65232d8cb81a95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.3.3

2 release files

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page