Skip to main content

A Python wrapper for gpt-vis-cli, enabling programmatic and command-line chart generation.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpt_vis-0.1.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpt_vis-0.1.1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file gpt_vis-0.1.1.tar.gz.

File metadata

  • Download URL: gpt_vis-0.1.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for gpt_vis-0.1.1.tar.gz
Algorithm Hash digest
SHA256 745d88085d69731d6373e288dabdd059146faee680c20485d085561a0ea9c4c7
MD5 a334465ff4ab05ec6637368c808d59d3
BLAKE2b-256 f4b7b1a8aa5f0cc6dd620e92ec322bac14d767a926d1d56c3409a910e458f809

See more details on using hashes here.

File details

Details for the file gpt_vis-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gpt_vis-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for gpt_vis-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b19d70460368881eea2d685b5fe260ee3db11de37d50ee79bd19e4efea9bf17
MD5 bd27734a22c6c5cff4e59f029ae5f978
BLAKE2b-256 d50703970478550d594f586b9e4ab46596d02f00faec3b0d5ea1e1b4e59e231d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page