Skip to main content

Chartroom

PyPI Changelog Tests License

CLI tool for creating charts from CSV, TSV, JSON, JSONL, or SQLite data using matplotlib. Designed to work well with Showboat.

Installation

pip install chartroom

Or:

uv tool install chartroom

Or run it directly with:

uvx chartroom

Demo

See the live demo document for examples of every chart type, input format, and style option with inline images. The demo was built using Showboat.

Usage

chartroom --help

Chart types

  • chartroom bar - Bar chart (vertical, supports grouped bars)
  • chartroom line - Line chart (supports multiple series)
  • chartroom scatter - Scatter plot
  • chartroom pie - Pie chart
  • chartroom histogram - Histogram

Data input

Provide data as a file, via stdin, or from a SQLite query:

# From a CSV file (auto-detected)
chartroom bar data.csv

# Explicit format
chartroom bar --csv data.csv
chartroom bar --tsv data.tsv
chartroom bar --json data.json
chartroom bar --jsonl data.jsonl

# From stdin
cat data.csv | chartroom bar --csv

# From SQLite
chartroom bar --sql mydb.sqlite "SELECT name, count FROM items"

Column selection

Columns are auto-detected from common names (name/label/x for x-axis, value/count/y for y-axis), or specify explicitly:

chartroom bar --csv -x region -y revenue data.csv

Multiple y columns create grouped/overlaid series:

chartroom bar --csv -x region -y q1 -y q2 -y q3 data.csv

Output

By default, saves to chart.png (incrementing to chart-2.png etc. to avoid overwrites). Use -o to specify a path:

chartroom bar --csv data.csv -o sales.png

The full absolute path of the output file is printed to stdout.

Output format

Use -f / --output-format to control what is printed to stdout:

# Default: just the file path
chartroom bar --csv data.csv
# /path/to/chart.png

# Markdown image syntax
chartroom bar --csv data.csv -f markdown --alt "Sales by region"
# ![Sales by region](/path/to/chart.png)

# HTML img tag
chartroom bar --csv data.csv -f html --alt "Sales by region"
# <img src="/path/to/chart.png" alt="Sales by region">

# JSON with path and alt text
chartroom bar --csv data.csv -f json
# {"path": "/path/to/chart.png", "alt": "Bar chart of value by name — ..."}

# Just the alt text
chartroom bar --csv data.csv -f alt
# Bar chart of value by name — alice: 10, bob: 20, charlie: 15

When --alt is omitted, alt text is auto-generated from the chart title (if set) or from the chart type and data. Small datasets get all values listed; larger datasets get a summary with range and extremes.

Alt text generation

Chartroom automatically generates descriptive alt text for every chart, making output accessible to screen readers and useful in documentation. You can use --alt to provide your own alt text, or let chartroom generate it from the chart type and data.

The auto-generated alt text adapts to both chart type and dataset size:

  • Bar, line, and scatter charts — Small datasets (6 rows or fewer) list every value (e.g. Bar chart of value by name — alice: 10, bob: 20, charlie: 15). Larger datasets summarize the count, range, and extremes (e.g. Bar chart of population by city. 10 points, ranging from 17118 (Dhaka) to 37400 (Tokyo)). Multiple y-columns are noted as additional series.
  • Pie charts — Small datasets show each category with its percentage (e.g. Pie chart showing Rent (57%), Food (19%), Transport (10%), Other (14%)). Larger datasets list the top 3 categories by share.
  • Histograms — Small datasets list all values. Larger datasets describe the distribution range (e.g. Histogram of 10 score values ranging from 76 to 95).

If a --title is set, it is prepended to the generated alt text (e.g. Team Scores. Bar chart of value by name — alice: 10, bob: 20, charlie: 15). The --alt option overrides this entirely with custom text. The alt text is embedded automatically when using -f markdown, -f html, or -f json output formats, or can be printed on its own with -f alt.

See the alt text demo for worked examples of every chart type and output format.

Styling

chartroom bar --csv data.csv --title "Sales" --xlabel "Region" --ylabel "Revenue" \
  --width 12 --height 8 --dpi 150 --style ggplot

Development

git clone https://github.com/simonw/chartroom
cd chartroom
uv run pytest

Release files for chartroom 0.2.1

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

Source distribution (sdist)

Source distribution for chartroom 0.2.1
File Size Uploaded
chartroom-0.2.1.tar.gz 20.6 kB Details

Built distribution (wheel)

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

Total release size: 35.9 kB

Release files / chartroom-0.2.1.tar.gz

Download URL chartroom-0.2.1.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ed4569606b707eca8799f68bedac39b794bdc3f607cdb5cff7c5a51384a653b0
BLAKE2b-256 checksum
How to use checksums
88654b342bb75a8581358b50d671b218f16d41095fafd5a07edea133b2fca472
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 14, 2026.

Transparency log

Release files / chartroom-0.2.1-py3-none-any.whl

Download URL chartroom-0.2.1-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5283a329e943b1ccabc92ad45712ee444e14bd212220bf371ff8623085ce04ca
BLAKE2b-256 checksum
How to use checksums
003a733cb04f3bf5e828a527a25dd2a51cb59e125b9acce0c42523f25b390b7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2

2 release files

0.1

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