Skip to main content

gpt-vis

English | 简体中文 | 日本語 | Español | Français | Deutsch

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

Metadata

Release files for gpt-vis 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gpt-vis 0.1.1
File Size Uploaded
gpt_vis-0.1.1.tar.gz 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gpt-vis 0.1.1
File Interpreter ABI Platform
gpt_vis-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.7 kB

Release files / gpt_vis-0.1.1.tar.gz

Download URL gpt_vis-0.1.1.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
745d88085d69731d6373e288dabdd059146faee680c20485d085561a0ea9c4c7
BLAKE2b-256 checksum
How to use checksums
f4b7b1a8aa5f0cc6dd620e92ec322bac14d767a926d1d56c3409a910e458f809
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Release files / gpt_vis-0.1.1-py3-none-any.whl

Download URL gpt_vis-0.1.1-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b19d70460368881eea2d685b5fe260ee3db11de37d50ee79bd19e4efea9bf17
BLAKE2b-256 checksum
How to use checksums
d50703970478550d594f586b9e4ab46596d02f00faec3b0d5ea1e1b4e59e231d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page