https://github.com/observedobserver/pygwalker-gradio
build data apps with pygwalker and gradio
https://github.com/observedobserver/pygwalker-gradio
Last synced: 10 months ago
JSON representation
build data apps with pygwalker and gradio
- Host: GitHub
- URL: https://github.com/observedobserver/pygwalker-gradio
- Owner: ObservedObserver
- License: mit
- Created: 2023-10-22T06:56:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-30T22:54:46.000Z (about 2 years ago)
- Last Synced: 2025-02-13T20:14:34.308Z (12 months ago)
- Language: Python
- Homepage: https://huggingface.co/spaces/observedobserver/pygwalker-gradio
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
---
sdk: gradio
sdk_version: 3.50.2
app_file: app.py
pinned: false
---
# pygwalker-gradio
## App 1: Visual Exploration of AirBnB Listings in NYC using [pygwalker](https://github.com/Kanaries/pygwalker)
> [pygwalker]() is a Python library that turns your dataframe/data connection into an interactive visualization module that allows you to analysis the data with drag-and-drop/chat interface, like tableau/powerBI.
Play a live demo on hugging face spaces: [play pygwalker](https://huggingface.co/spaces/observedobserver/pygwalker-gradio)
Run the app
## Native Support for Gradio Integration
What is the native way to integrate pygwalker with gradio. pygwalker contains a feature called 'kernel computation', which runs a computation engine based on duckDB to handle the data queries from user's interaction.
This is a powerful feature but requires extra setup from pygwalker. Since `pygwalker>=0.3.10a2`, pygwalker provide a native support for gradio developers to enable this feature:
```python
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")
# use get_html_on_gradio, which contains the logic to enable kernel computation
pyg_html = get_html_on_gradio(df, spec="gw.json", debug=True)
gr.HTML(pyg_html)
app = demo.launch(app_kwargs={
"routes": [PYGWALKER_ROUTE]
})
```
+ [app.py](./app.py) pygwalker's kernel computation in gradio
+ [app_lite.py] basic example, without kernel computation