rameshmoorthy commited on
Commit
a246aa4
·
verified ·
1 Parent(s): b9cae72

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -33
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
- 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
 
 
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