rameshmoorthy's picture
Update app.py
1065d81 verified
raw
history blame
833 Bytes
import pandas as pd
import ydata_profiling
import gradio as gr
from pydantic_settings import BaseSettings
from pandasgui import show
import sweetviz as sv
def generate_report(file,type):
df = pd.read_csv(file) if file.name.endswith(".csv") else pd.read_excel(file)
if type == "pandas profiling":
return ydata_profiling.ProfileReport(df).to_html()
elif type == "pandasGUI":
return show(df)
elif type == "sweetviz":
return sv.analyze(global_df).show_html()
iface = gr.Interface(
generate_report,
[gr.File(file_types=['.csv','.xlsx'], label="Upload a CSV or Excel file"),
gr.Radio(["pandas profiling", "pandasGUI", "sweetviz"], label="Type of report", info="Explore the data")],
"html",
title="Pandas Profiling Report",
live=True,
)
iface.launch(share=True)