Update app.py
Browse files
app.py
CHANGED
@@ -14,14 +14,38 @@ def generate_report(file,type):
|
|
14 |
layout='widescreen',
|
15 |
scale=None)
|
16 |
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
|
20 |
profile = gr.Interface(
|
21 |
generate_report,
|
22 |
[gr.File(file_types=['.csv','.xlsx'], label="Upload a CSV or Excel file"),
|
23 |
gr.Radio(["pandas profiling", "sweetviz"], label="Type of report", info="Explore the data")],
|
24 |
-
gr.HTML(label="Data profile Report"),
|
25 |
title="Excel sheet Profiling Report",
|
26 |
live=True,
|
27 |
)
|
@@ -30,7 +54,7 @@ cluster = gr.Interface(
|
|
30 |
generate_report,
|
31 |
[gr.File(file_types=['.csv','.xlsx'], label="Upload a CSV or Excel file"),
|
32 |
gr.Radio(["pandas profiling", "sweetviz"], label="Type of report", info="Explore the data")],
|
33 |
-
gr.HTML(label="Data profile Report"),
|
34 |
title="Excel sheet Profiling Report",
|
35 |
live=True,
|
36 |
)
|
|
|
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 |
profile = gr.Interface(
|
45 |
generate_report,
|
46 |
[gr.File(file_types=['.csv','.xlsx'], label="Upload a CSV or Excel file"),
|
47 |
gr.Radio(["pandas profiling", "sweetviz"], label="Type of report", info="Explore the data")],
|
48 |
+
gr.HTML(label="Data profile Report",type="auto", html_content=custom_html),
|
49 |
title="Excel sheet Profiling Report",
|
50 |
live=True,
|
51 |
)
|
|
|
54 |
generate_report,
|
55 |
[gr.File(file_types=['.csv','.xlsx'], label="Upload a CSV or Excel file"),
|
56 |
gr.Radio(["pandas profiling", "sweetviz"], label="Type of report", info="Explore the data")],
|
57 |
+
gr.HTML(label="Data profile Report",type="auto", html_content=custom_html),
|
58 |
title="Excel sheet Profiling Report",
|
59 |
live=True,
|
60 |
)
|