File size: 498 Bytes
0a5d39a
7a75289
0a5d39a
71c9026
0a5d39a
 
 
7a75289
0a5d39a
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import pandas as pd
import ydata_profiling
import gradio as gr
from pydantic_settings import BaseSettings

def generate_report(file):
    df = pd.read_csv(file) if file.name.endswith(".csv") else pd.read_excel(file)
    report = ydata_profiling.ProfileReport(df)
    return report.to_html()

iface = gr.Interface(
    generate_report,
    [gr.File(accept=".csv,.xlsx", label="Upload a CSV or Excel file")],
    "html",
    title="Pandas Profiling Report",
    live=True,
)

iface.launch(share=True)