Update app.py
Browse files
app.py
CHANGED
@@ -4,41 +4,41 @@ import gradio as gr
|
|
4 |
from pydantic_settings import BaseSettings
|
5 |
|
6 |
import sweetviz as sv
|
7 |
-
def generate_report(file,type):
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
|
17 |
-
# Custom HTML template for styling the report output
|
18 |
-
custom_html = """
|
19 |
-
<!DOCTYPE html>
|
20 |
-
<html>
|
21 |
-
<head>
|
22 |
-
<title>Data Profile Report</title>
|
23 |
-
<style>
|
24 |
-
body {
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
}
|
29 |
-
.container {
|
30 |
-
|
31 |
-
|
32 |
-
}
|
33 |
-
</style>
|
34 |
-
</head>
|
35 |
-
<body>
|
36 |
-
<div class="container">
|
37 |
-
{content}
|
38 |
-
</div>
|
39 |
-
</body>
|
40 |
-
</html>
|
41 |
-
"""
|
42 |
|
43 |
|
44 |
|
|
|
4 |
from pydantic_settings import BaseSettings
|
5 |
|
6 |
import sweetviz as sv
|
7 |
+
# def generate_report(file,type):
|
8 |
+
# df = pd.read_csv(file) if file.name.endswith(".csv") else pd.read_excel(file)
|
9 |
+
# if type == "pandas profiling":
|
10 |
+
# return ydata_profiling.ProfileReport(df).to_html()
|
11 |
|
12 |
+
# elif type == "sweetviz":
|
13 |
+
# return sv.analyze(df).show_html(open_browser=True,
|
14 |
+
# layout='widescreen',
|
15 |
+
# scale=None)
|
16 |
|
17 |
+
# # Custom HTML template for styling the report output
|
18 |
+
# custom_html = """
|
19 |
+
# <!DOCTYPE html>
|
20 |
+
# <html>
|
21 |
+
# <head>
|
22 |
+
# <title>Data Profile Report</title>
|
23 |
+
# <style>
|
24 |
+
# body {
|
25 |
+
# font-family: Arial, sans-serif;
|
26 |
+
# margin: 0;
|
27 |
+
# padding: 20px;
|
28 |
+
# }
|
29 |
+
# .container {
|
30 |
+
# width: 80%;
|
31 |
+
# margin: auto;
|
32 |
+
# }
|
33 |
+
# </style>
|
34 |
+
# </head>
|
35 |
+
# <body>
|
36 |
+
# <div class="container">
|
37 |
+
# {content}
|
38 |
+
# </div>
|
39 |
+
# </body>
|
40 |
+
# </html>
|
41 |
+
# """
|
42 |
|
43 |
|
44 |
|