-
Notifications
You must be signed in to change notification settings - Fork 0
/
FUNCTIONS.py
114 lines (91 loc) · 2.93 KB
/
FUNCTIONS.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
113
114
#Richard Castro
#Functions for holiday Topbar
from LIBRARIES import *
from datetime import datetime
date = datetime.now().strftime("%m/%d")
displayHoliday='No Food Holiday today :( Check back tomorrow'
#Create a python list instead of the single variable above to hold multiple holiday on the same day.
holidays=pd.read_csv('Holiday-List.csv', header=None, index_col=0, squeeze=True).to_dict()
for key,value in holidays.items():
if (key == date):
displayHoliday=value
#Change this to append the list of holidays on the same day above instead of just changing the single variable.
app = dash.Dash(
__name__,
meta_tags=[
{
"name": "viewport",
"content": "width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no",
}],)
server = app.server
app.config["suppress_callback_exceptions"] = True
app.layout = html.Div(
className="Content-Box",
children=[
# html.Div(
# className="Header",
# children=[
# html.Div(
# id='Logo-Box',
# className="LogoBox",
# children=[
# html.Img(
# id='Logo',
# className="Logo",
# src="assets/logo.png")]),
#
# html.Div(
# id='Title-Box',
# className="titleBox",
# children=[
# html.H2(
# id='title',
# className="title",
# children=["Food Holiday Calendar"])]),
# ]),
html.Div(
className="Bod",
children=[
# IMAGE FOR HOLIDAY SOURCED FROM URL LINK IN CSV
# html.Div(children=[displayHoliday]),
html.Div(
id='Holi-Content-Box',
className="HoliBox",
children=[
html.Img(
id='HoliImg',
className="HoliImg",
src=displayHoliday)]),
#
# # Desccription for holiday from column in csv
# html.Div(
# id='Title-Box',
# className="titleBox",
# children=[
# html.H2(
# id='title',
# className="title",
# children=["Food Holiday Calendar"])]),
#
]),html.Div(className="power",children=[
html.P(className="powerP",children=['Powered by:']),
html.Img(className="powerImg", src="assets/logo.png")
])
])
# app.layout = html.Div(
# className="box",
# children=[
# html.Div(
# id='',
# className="contentBox",
# children=[
# html.A(
# id='',
# className="content",
# children=[
# date,' - ',displayHoliday
# ]
# )
# ])
# ]
# )