-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
55 lines (34 loc) · 1.52 KB
/
app.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
from flask import Flask, redirect, url_for, render_template
# redirect - redirects user from pages they aren't supposed to be in
# url_for - gives the app route for the function that is being inputted
# render_template- shows the HTML webpage
from main import diversity, equity, inclusion, diversity_print, equity_print, inclusion_print
# The main.py file is referenced here and the functions in that file are imported here.
app = Flask(__name__)
# This is the default app route, and where the user goes when they first open the page.
@app.route("/")
def home():
return render_template('website.html')
@app.route("/diversity")
def run_diversity():
# The 'diversity()' function is what produces the graphs.
diversity("sample_dataset.csv")
# The 'diversity_print()' function is what produces the written summary for the user.
a= diversity_print("sample_dataset.csv")
return a
@app.route("/equity")
def run_equity():
# The 'equity()' function is what produces the graphs.
equity("sample_dataset.csv")
# The 'equity_print()' function is what produces the written summary for the user.
b= equity_print("sample_dataset.csv")
return b
@app.route("/inclusion")
def run_inclusion():
# The 'inclusion()' function is what produces the graphs.
inclusion("sample_dataset.csv")
# The 'inclusion_print()' function is what produces the written summary for the user.
c = inclusion_print("sample_dataset.csv")
return c
if __name__ == "__main__":
app.run()