Spaces:
Build error
Build error
import supabase | |
import pandas as pd | |
import os | |
client = supabase.create_client(os.environ['SUPABASE_URL'], os.environ['SUPABASE_SECRET_KEY']) | |
def read_data(): | |
response = client.table('Product').select("*").execute() | |
df = pd.DataFrame(response.data) | |
return df | |
import gradio as gr | |
with gr.Blocks() as dashboard: | |
with gr.Row(): | |
gr.BarPlot(read_data, x="product_id", y="price", title="Prices", every=60) | |
gr.BarPlot(read_data, x="product_id", y="inventory_count", title="Inventory", every=60) | |
dashboard.queue().launch() | |