A Python wrapper for gpt-vis-cli, enabling programmatic and command-line chart generation.
Project description
gpt-vis
A Python wrapper for gpt-vis-cli, enabling programmatic and command-line chart generation.
Installation
Install the package using pip:
pip install gpt-vis
Or, if you have cloned the repository, you can install it in editable mode using Poetry:
poetry install
Usage
As a Python Library
You can use gpt-vis to generate charts programmatically within your Python applications.
from gpt_vis_python.charts import render_bar_chart, BarChartOptions, BarChartData
# Define options for a bar chart
bar_chart_options = BarChartOptions(
data=[
BarChartData(category="A", value=10),
BarChartData(category="B", value=20),
BarChartData(category="C", value=15),
],
title="Sample Bar Chart",
axisXTitle="Category",
axisYTitle="Value",
)
# Render the bar chart and save it to a file
render_bar_chart(options=bar_chart_options, output_path="bar_chart.png")
As a Command-Line Tool
gpt-vis also provides a command-line interface for quick chart generation.
gpt-vis '''{"type": "bar", "data": [{"category": "A", "value": 10}, {"category": "B", "value": 20}], "title": "My Chart"}''' output.png
Available Charts
gpt-vis supports a wide variety of chart types:
- Area
- Bar
- Boxplot
- Column
- District Map
- Dual Axes
- Fishbone Diagram
- Flow Diagram
- Funnel
- Histogram
- Line
- Liquid
- Mind Map
- Network Graph
- Organization Chart
- Path Map
- Pie
- Radar
- Sankey
- Scatter
- Treemap
- Venn
- Violin
- Word Cloud
For detailed options for each chart type, please refer to the gpt_vis_python/charts.py file.
Development
To run the tests, execute the following command:
poetry run pytest
To run the demo, which generates a variety of chart images in the output directory:
poetry run python run.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gpt_vis-0.1.0.tar.gz.
File metadata
- Download URL: gpt_vis-0.1.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01722cf1f99d56d78d3f4abc6f31747f8ef141036e4451e30ff0c8b98deec570
|
|
| MD5 |
91b76106eec24dc0e67cb7acc9122dff
|
|
| BLAKE2b-256 |
bf8aed0da14b38dd8932d02ce89a856ec8d358fdb00c73fa725d6651fb3aa739
|
File details
Details for the file gpt_vis-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gpt_vis-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01289ee9f4803658c2665f049387c4866a67a54e320aeb4ac4710d23cd940245
|
|
| MD5 |
65b876e3577f1200a1244d7eecf02db0
|
|
| BLAKE2b-256 |
3678f84c1851299b7b3c3f223eb410da0ef7984dad67b37873fa2cbc2b5401f1
|