Natural language to chart generator -- a Python library that generates beautiful charts from natural language descriptions of your data.
graph LR
A[Natural Language Query] --> B[QueryParser]
B --> C[ChartConfig]
D[CSV / JSON / DataFrame] --> E[DataLoader]
E --> F[pandas DataFrame]
C --> G[ChartRenderer]
F --> G
G --> H[Bar Chart]
G --> I[Line Chart]
G --> J[Pie Chart]
G --> K[Scatter Plot]
G --> L[Histogram]
G --> M[Heatmap]
H --> N[PNG / SVG Output]
I --> N
J --> N
K --> N
L --> N
M --> N
pip install chartmindfrom chartmind import ChartGenerator
gen = ChartGenerator()
# Generate a chart from a natural language query + CSV file
config = gen.generate(
query="Show total revenue by month as a bar chart",
data="sales.csv",
output="chart.png",
)
print(config.chart_type) # "bar"
print(config.title) # "Sum Revenue by Month"import pandas as pd
from chartmind import ChartGenerator
df = pd.DataFrame({
"region": ["North", "South", "East", "West"],
"sales": [120, 98, 150, 130],
})
gen = ChartGenerator()
config = gen.generate(
query="pie chart of sales by region",
data=df,
output="pie.png",
)config = gen.generate_config(
"average score by department",
columns=["score", "department"],
)
# Returns a plain dict: {"chart_type": "bar", "aggregation": "mean", ...}chartmind "show revenue trend over time by month" --data sales.csv --output trend.png| Type | Trigger Keywords |
|---|---|
| bar | bar, compare, column chart |
| line | line, trend, over time, timeline |
| scatter | scatter, correlation, relationship, xy |
| pie | pie, proportion, share, breakdown |
| histogram | histogram, distribution, frequency |
| heatmap | heatmap, heat map, matrix, density |
- Auto-detect the best chart type from natural language queries
- Keyword-based NLP -- no ML dependencies, fast and deterministic
- Supports aggregation (sum, mean, count, min, max)
- Filter clauses ("where region equals North")
- Six chart types: bar, line, scatter, pie, histogram, heatmap
- CSV and JSON data loading via pandas
- High-quality matplotlib output (PNG, SVG, PDF)
- Pydantic-validated configuration models
- CLI powered by Typer
# Clone the repository
git clone https://github.com/MukundaKatta/ChartMind.git
cd ChartMind
# Install in development mode
make install-dev
# Run tests
make test
# Run linter
make lint
# Type checking
make typecheckSee CONTRIBUTING.md for guidelines.
MIT License -- 2026 Officethree Technologies
Inspired by data visualization AI trends
Built by Officethree Technologies | Made with ❤️ and AI