Metadata-Version: 2.5
Name: graph2table
Version: 0.1.1
Summary: Client for the graph2table API: send a chart image, get the data table.
Project-URL: Homepage, https://graph2table.com
Project-URL: Documentation, https://graph2table.com/docs/api
Project-URL: Benchmark, https://graph2table.com/blog/chartx-technical-report
Author: graph2table
License-Expression: MIT
License-File: LICENSE
Keywords: chart,chart to table,csv,data extraction,graph,plot digitizer
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Requires-Dist: requests>=2.28
Description-Content-Type: text/markdown

# graph2table

Python client for the [graph2table](https://graph2table.com) API. Send a chart image, get the data table.

graph2table automatically extracts the data table from a chart image.

## Install

```
pip install graph2table
```

## Use

```python
from graph2table import convert

result = convert("figure.png", api_key="YOUR_API_KEY")

result.headers          # ['x', 'Series A', 'Series B']
result.rows[0]          # {'x': 0.0, 'Series A': 12.4, 'Series B': 9.1}
result.to_csv("figure.csv")
result.to_dataframe()   # pandas, if installed
```

Get an API key at https://graph2table.com/app/keys. Set the `GRAPH2TABLE_API_KEY` environment variable to skip the `api_key` argument.

The image can be a file path, raw bytes, or an open file. PNG, JPG and WebP up to 10 MB.

To focus the extraction, pass `custom_instructions="Extract only the red series"`.

Errors raise `Graph2TableError` with the HTTP status and the API message.

## Check the result

Open the same image at https://graph2table.com/converter to see every extracted point drawn on the chart, and correct a point before you export.

## Links

- API reference: https://graph2table.com/docs/api
- Accuracy and released data: https://graph2table.com/blog/chartx-technical-report
