Getting started
Read one guideline and cite its sources in Python, TypeScript, or the CLI.
Open the public Guideline Catalog, read a recommendation about direct labels, and cite its sources. Choose your interface in the tabs. That choice carries through the examples and other guides.
Install
Use uv, a Python environment manager. In a POSIX shell:
uv venv
source .venv/bin/activate
uv pip install chartcoachKeep this environment active for the Python examples.
Read a guideline
Opening the public catalog needs network access on the first run. Downloaded release files are verified and cached locally.
Save as read-guideline.py:
from chartcoach import open_catalog
catalog = open_catalog()
guideline_id = "directly-label-series-instead-of-using-a-color-key"
record = catalog.read(ids=[guideline_id])[0]
print(record["title"])python read-guideline.pyThe guideline's title is Directly label colored series instead of relying on a color key. Python and TypeScript return a record with labels, ordered sections, and parsed source details. The CLI renders that record as Markdown.
Read the advice and cite its source
Read the recommendation's context before applying it. Each interface can select the advice section and retrieve both the guideline link and source citations.
Save as cite-guideline.py:
from chartcoach import open_catalog
catalog = open_catalog()
guideline_id = "directly-label-series-instead-of-using-a-color-key"
record = catalog.read(ids=[guideline_id])[0]
for section in record["sections"]:
if section["role"] == "advice":
print(section["content"])
citation = catalog.cite(ids=[guideline_id])[0]
print(citation["guideline_citation"])
for source in citation["sources"]:
print(source["citation"])python cite-guideline.pyUse Find guidelines to choose evidence for your own task, or Open and cache catalogs to work with another catalog.