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

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.3
File Size Uploaded
chartcoach-0.3.3.tar.gz 92.8 kB Details

Built distribution (wheel)

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

Total release size: 225.8 kB

Release files / chartcoach-0.3.3.tar.gz

Download URL chartcoach-0.3.3.tar.gz
Size 92.8 kB
Tags Source
SHA-256 checksum
How to use checksums
43a0971770bc77f506ca52cc80d065e0c938888e1de89e68b3ebb5d8d3f2fc99
BLAKE2b-256 checksum
How to use checksums
861dfe93186e55a5831a6afc9f98ed87918d5e6b54cdeb152ffb507f61e91fa3
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.3-py3-none-any.whl

Download URL chartcoach-0.3.3-py3-none-any.whl
Size 133.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
064e3feb2daa4a3e61f93991e495720ba29850d75d4d96691e9955ca01d9f70f
BLAKE2b-256 checksum
How to use checksums
391af57ed0d23d821ec9c64354fb184aadacf7064f2078959496bab45ccc89f1
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

This release

0.3.3 This release

2 release files

0.3.2

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