langchain-chartquery
LangChain integration for ChartQuery: turn data into charts, descriptions into diagrams, and text into QR codes, as image links.
Installation
pip install -U langchain-chartquery
export CHARTQUERY_API_KEY="your-api-key"
Get an API key at app.chartquery.com.
Tools
| Class | Tool name | What it does |
|---|---|---|
ChartQueryChart |
chartquery_chart |
Render a Chart.js chart through ChartQuery and return links to the image. |
ChartQueryChartFromPrompt |
chartquery_chart_from_prompt |
Build a chart from a plain-words description through ChartQuery. |
ChartQueryDiagram |
chartquery_diagram |
Render a diagram from its source through ChartQuery. |
ChartQueryQRCode |
chartquery_qr_code |
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 model as a ToolException message, without the API key. Every tool has an async version.
from langchain_chartquery import ChartQueryChart
tool = ChartQueryChart()
print(tool.invoke({"chart_config": '{"type": "bar", "data": {"labels": ["a"]}}'}))
In an agent
from langchain.agents import create_agent
from langchain_chartquery import ChartQueryChart, ChartQueryChartFromPrompt, ChartQueryDiagram
agent = create_agent("openai:gpt-4.1-mini", tools=[ChartQueryChart(), ChartQueryChartFromPrompt(), ChartQueryDiagram()])
result = agent.invoke({"messages": [{"role": "user", "content": "..."}]})
Development
pip install -e ".[test]"
pytest tests/unit_tests
License
MIT
Metadata
Release files for langchain-chartquery 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_chartquery-0.1.0.tar.gz | 8.0 kB | Without provenance | Details for langchain_chartquery-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_chartquery-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for langchain_chartquery-0.1.0-py3-none-any.whl |
Total release size: 15.6 kB
Release files / langchain_chartquery-0.1.0.tar.gz
| Download URL | langchain_chartquery-0.1.0.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
318975dcc8af979b90d60b1dd9a315a132c4f5c087a38d85b209c5d7d390d935
|
|
BLAKE2b-256 checksum How to use checksums |
599abb7f3f271bbf73c0c381b3a9fa05bb7ff13ebeda50f8140ec29a3c1712ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / langchain_chartquery-0.1.0-py3-none-any.whl
| Download URL | langchain_chartquery-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
37986a71ebad4df204ccc36be89b79758eca13d184a514c7bd3d15cd27f21e5b
|
|
BLAKE2b-256 checksum How to use checksums |
a137203e65aa07782692c9caa984dca9b27ec48d50d6720ef2f9442ebc7e6784
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for langchain-chartquery 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.