File size: 551 Bytes
224e5eb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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()