Metadata-Version: 2.5
Name: crewai-chartquery
Version: 0.1.0
Summary: CrewAI tools for ChartQuery: turn data into charts, descriptions into diagrams, and text into QR codes, as image links.
Project-URL: Homepage, https://www.chartquery.com
Project-URL: Documentation, https://github.com/chartquery/crewai-chartquery#readme
Project-URL: Repository, https://github.com/chartquery/crewai-chartquery
Project-URL: Issues, https://github.com/chartquery/crewai-chartquery/issues
Author-email: ChartQuery <contact@chartquery.com>
License-Expression: MIT
License-File: LICENSE
Keywords: agents,chartjs,chartquery,charts,crewai,data-visualization,diagrams,mermaid,qrcode,tools
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Typing :: Typed
Requires-Python: <3.14,>=3.10
Requires-Dist: crewai>=0.150
Requires-Dist: httpx<1,>=0.27
Provides-Extra: test
Requires-Dist: pytest>=8.3; extra == 'test'
Requires-Dist: ruff<1,>=0.8; extra == 'test'
Description-Content-Type: text/markdown

# crewai-chartquery

[CrewAI](https://www.crewai.com) tools for [ChartQuery](https://www.chartquery.com): turn data into charts, descriptions into diagrams, and text into QR codes, as image links.

## Installation

```bash
pip install crewai-chartquery
export CHARTQUERY_API_KEY="your-api-key"
```

Get an API key at [app.chartquery.com](https://app.chartquery.com).

## Tools

| Tool | What it does |
| --- | --- |
| `ChartQueryChartTool` | Render a Chart.js chart through ChartQuery and return links to the image. |
| `ChartQueryChartFromPromptTool` | Build a chart from a plain-words description through ChartQuery. |
| `ChartQueryDiagramTool` | Render a diagram from its source through ChartQuery. |
| `ChartQueryQRCodeTool` | Generate a QR code through ChartQuery. |

Each tool takes `api_key` (defaults to `CHARTQUERY_API_KEY`), `base_url` and `timeout`, plus the settings shown in its docstring. Errors (invalid key, no credits, rate limit, timeout) come back to the agent as text, without the API key.

```python
from crewai import Agent
from crewai_chartquery import ChartQueryChartTool, ChartQueryChartFromPromptTool

agent = Agent(
    role="Analyst",
    goal="Answer with data from ChartQuery",
    backstory="You use ChartQuery to turn data into charts.",
    tools=[ChartQueryChartTool(), ChartQueryChartFromPromptTool()],
)

print(ChartQueryChartTool().run(**{"chart_config": '{"type": "bar", "data": {"labels": ["a"]}}'}))
```

## Development

```bash
pip install -e ".[test]"
pytest
```

## License

MIT
