-
Notifications
You must be signed in to change notification settings - Fork 2
/
template.py
112 lines (99 loc) · 3.48 KB
/
template.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
"""Provide a base HTML template variable for population with appropriate
statistics in the report.py module.
"""
base_template = \
"""
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="../main.css">
<title>Analysis Report on {header}</title>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Contents</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#invalid">Invalid/Empty</a></li>
<li><a href="#numerical">Numerical</a></li>
<li><a href="#string">String</a></li>
<li><a href="#enum">Enum</a></li>
</ul>
</div>
</div>
</nav>
<div class="container">
<h1>Analysis Report on {header}</h1>
</div>
<div class="container">
<div class="row">
<hr id="invalid"/>
<div class="col-md-6">
<h2>Invalid Rows ({len_invalid_rows})</h2>
<p>These rows contain either too many or too few columns.</p>
{invalid_rows}
</div>
<div class="col-md-6">
<h2>Empty Columns ({len_empty_columns})</h2>
<p>These columns contain >= 90% empty values.</p>
{empty_columns}
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>Column Analysis (Based on {len_columns} rows)</h2>
<hr id="numerical"/>
<h2>Numerical</h2>
<table class="table table-bordered table-hover">
<tr>
<th>Column</th>
<th>Min</th>
<th>Max</th>
<th>Mode</th>
<th>Mean</th>
<th>Median Low</th>
<th>Median</th>
<th>Median High</th>
<th>Most Common (Top 5)</th>
</tr>
{numerical_analysis}
</table>
<hr id="string"/>
<h2>String</h2>
<table class="table table-bordered table-hover">
<tr>
<th>Column</th>
<th>Mode</th>
<th>Most Common (Top 5)</th>
</tr>
{string_analysis}
</table>
<hr id="enum"/>
<h2>Enumerated</h2>
<table class="table table-bordered table-hover">
<tr>
<th>Column</th>
<th>Mode</th>
<th>Most Common (Top 5)</th>
</tr>
{enum_analysis}
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body>
"""