Skip to content

Use pygwalker in graido

Douding edited this page Nov 2, 2023 · 2 revisions

Install dependencies

pip install --pre "pygwalker>=0.3.10"
pip install gradio
pip install pandas

Coding

  • gradio_demo.py
import gradio as gr
import pandas as pd

from pygwalker.api.gradio import PYGWALKER_ROUTE, get_html_on_gradio

with gr.Blocks() as demo:
    df = pd.read_csv("xxx.csv")
    pyg_html = get_html_on_gradio(df, spec="gw_config.json", debug=True)
    gr.HTML(pyg_html)


app = demo.launch(app_kwargs={
    "routes": [PYGWALKER_ROUTE]
})

Run

gradio gradio_demo.py