nesticot commited on
Commit
95914a4
1 Parent(s): 611e555

Upload 5 files

Browse files
Files changed (5) hide show
  1. Dockerfile +16 -0
  2. app.py +41 -0
  3. configure.py +2 -0
  4. home.py +89 -0
  5. requirements.txt +310 -0
Dockerfile ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ # Install dependencies
4
+ COPY requirements.txt /app/
5
+ RUN pip install -r /app/requirements.txt
6
+
7
+ # Copy app files
8
+ COPY app_name /app/app_name/
9
+ COPY static/ /app/static/
10
+ COPY templates/ /app/templates/
11
+
12
+ # Set working directory
13
+ WORKDIR /app/app_name
14
+
15
+ # Set the command to run the app
16
+ CMD ["python", "app.py"]
app.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Thomas Nestico
2
+ ### @TJStats
3
+ #Import modules
4
+ from starlette.applications import Starlette
5
+ from starlette.routing import Mount
6
+ from starlette.staticfiles import StaticFiles
7
+ from shiny import App, ui
8
+ import shinyswatch
9
+
10
+ #Import pages
11
+ from home import home
12
+ # from about import about
13
+ # from gsax_timeline import gsax_timeline
14
+ # from on_ice_xg_rates import on_ice_xg
15
+ # from gsax_leaderboard import gsax_leaderboard
16
+ # from on_ice_xgfp import on_ice_xgfp
17
+ # from team_xg_rates import team_xg_rates
18
+ # from gsax_comparison import gsax_comparison
19
+ # from game import game
20
+ # from games import games
21
+ # from articles import articles
22
+ # from xg_model import xg_model
23
+
24
+ # Create app
25
+ routes = [
26
+ Mount('/home', app=home),
27
+ # Mount('/about', app=about),
28
+ # Mount('/gsax-timeline', app=gsax_timeline),
29
+ # Mount('/skater-xg-rates', app=on_ice_xg),
30
+ # Mount('/gsax-leaderboard', app=gsax_leaderboard),
31
+ # Mount('/skater-xg-percentages', app=on_ice_xgfp),
32
+ # Mount('/team-xg-rates', app=team_xg_rates),
33
+ # Mount('/gsax-comparison',app=gsax_comparison),
34
+ # Mount('/games',app=games),
35
+ # Mount('/game/{game_id}',app=game),
36
+ # Mount('/articles',app=articles),
37
+ # Mount('/xg-model',app=xg_model)
38
+ ]
39
+
40
+ #Run App
41
+ app = Starlette(routes=routes)
configure.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ base_url = "https://nesticot-tjstats-site.hf.space/"
2
+ # base_url = 'http://127.0.0.1:8000'
home.py ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ##### home.py #####
2
+ # Home page
3
+ # Thomas Nestico
4
+
5
+ # Import modules
6
+ from shiny import *
7
+ import shinyswatch
8
+ import plotly.express as px
9
+ from shinywidgets import output_widget, render_widget
10
+ import pandas as pd
11
+ from configure import base_url
12
+
13
+ # Create app
14
+ home = App(ui.page_fluid(
15
+ ui.tags.base(href=base_url),
16
+ ui.tags.div(
17
+ {"style": "width:75%;margin: 0 auto;max-width: 1500px;"},
18
+ ui.tags.style(
19
+ """
20
+ h4 {
21
+ margin-top: 1em;font-size:35px;
22
+ }
23
+ h2{
24
+ font-size:25px;
25
+ }
26
+ """
27
+ ),
28
+ shinyswatch.theme.darkly(),ui.tags.h4("Stats By Zach"),
29
+ ui.tags.i("A website for hockey analytics"),
30
+ ui.navset_tab(
31
+ ui.nav_control(
32
+ ui.a(
33
+ "Home",
34
+ href="home/"
35
+ ),
36
+ ),
37
+ ui.nav_menu(
38
+ "Skater Charts",
39
+ ui.nav_control(
40
+ ui.a(
41
+ "On-Ice xG Rates",
42
+ href="skater-xg-rates/"
43
+ ),
44
+ ui.a(
45
+ "On-Ice xGF%",
46
+ href="skater-xg-percentages/"
47
+ ),
48
+ ),
49
+ ),
50
+ ui.nav_menu(
51
+ "Goalie Charts",
52
+ ui.nav_control(
53
+ ui.a(
54
+ "GSAx Timeline",
55
+ href="gsax-timeline/"
56
+ ),
57
+ ui.a(
58
+ "GSAx Leaderboard",
59
+ href="gsax-leaderboard/"
60
+ ),
61
+ ui.a(
62
+ "GSAx Comparison",
63
+ href="gsax-comparison/"
64
+ )
65
+ ),
66
+ ),ui.nav_menu(
67
+ "Team Charts",
68
+ ui.nav_control(
69
+ ui.a(
70
+ "Team xG Rates",
71
+ href="team-xg-rates/"
72
+ ),
73
+ ),
74
+ ),ui.nav_control(
75
+ ui.a(
76
+ "Games",
77
+ href="games/"
78
+ ),
79
+ ),ui.nav_control(
80
+ ui.a(
81
+ "About",
82
+ href="about/"
83
+ ),
84
+ ),ui.nav_control(
85
+ ui.a(
86
+ "Articles",
87
+ href="articles/"
88
+ ),
89
+ )),ui.tags.br(),ui.tags.h5("Welcome to Stats By Zach!"),ui.tags.h6("The 2023-24 NHL regular season is here, and the StatsByZach website is officially up and running for it! As I've state before, this website is still a work in progress, with lots of work to be done in terms of styling and compatibility especially. Along with that, I am focusing on finding a new hosting solution, adding more charts, and some prerformace enhancements as well. Thank you for paying the site a visit, and I do hope you can use my data to better understand the NHL. The website gets updated daily, and I try to make improvements on a regular basis, so please do visit the site often, and feel free to reach out to me on Twitter @StatsByZach for any feedback or suggestions. Enjoy the site, and happy hockey season!"))), None)
requirements.txt ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # requirements.txt generated by rsconnect-python on 2023-04-20 21:38:50.254957
2
+ adjustText==0.7.3
3
+ aiohttp==3.8.1
4
+ aiosignal==1.2.0
5
+ altair==4.2.0
6
+ ansicolors==1.1.8
7
+ anyio==3.6.2
8
+ appdirs==1.4.4
9
+ argon2-cffi==21.1.0
10
+ asgiref==3.5.2
11
+ aspose-words==22.10.0
12
+ asttokens==2.2.1
13
+ async-timeout==4.0.2
14
+ atomicwrites==1.4.0
15
+ attrs==20.3.0
16
+ backcall==0.2.0
17
+ bandit==1.7.4
18
+ baseball-scraper==0.4.10
19
+ beautifulsoup4==4.9.3
20
+ bleach==4.1.0
21
+ branca==0.4.2
22
+ bs4==0.0.1
23
+ cachetools==5.2.0
24
+ cairocffi==1.2.0
25
+ CairoSVG==2.6.0
26
+ calfem-python==3.5.9
27
+ certifi==2020.12.5
28
+ cffi==1.14.5
29
+ chardet==4.0.0
30
+ charset-normalizer==2.0.11
31
+ chart-studio==1.1.0
32
+ click==8.1.3
33
+ click-plugins==1.1.1
34
+ cligj==0.7.2
35
+ colorama==0.4.4
36
+ colour==0.1.5
37
+ commonmark==0.9.1
38
+ contextvars==2.4
39
+ coverage==6.5.0
40
+ cryptography==38.0.1
41
+ cssselect==1.1.0
42
+ cssselect2==0.4.1
43
+ cssutils==2.2.0
44
+ cycler==0.10.0
45
+ dash==2.9.3
46
+ dash-core-components==2.0.0
47
+ dash-html-components==2.0.0
48
+ dash-table==5.0.0
49
+ dataframe-image==0.1.7
50
+ DateTime==4.3
51
+ decorator==4.4.2
52
+ decorest==0.0.6
53
+ defusedxml==0.7.1
54
+ Deprecated==1.2.13
55
+ deserialize==1.8.1
56
+ df2img==0.2.9
57
+ Django==4.1.1
58
+ dmsh==0.2.19
59
+ docopt==0.6.2
60
+ entrypoints==0.3
61
+ et-xmlfile==1.0.1
62
+ executing==1.2.0
63
+ ezdxf==0.17.2
64
+ fastapi==0.95.0
65
+ fastjsonschema==2.16.3
66
+ flake8==5.0.4
67
+ Flask==2.2.3
68
+ folium==0.12.1.post1
69
+ fonttools==4.31.2
70
+ frozenlist==1.3.0
71
+ fsspec==2023.4.0
72
+ fuzzywuzzy==0.18.0
73
+ geomdl==5.3.1
74
+ gitdb==4.0.9
75
+ GitPython==3.1.29
76
+ gmsh==4.9.5
77
+ google-api-core==2.10.1
78
+ google-api-python-client==2.63.0
79
+ google-auth==2.12.0
80
+ google-auth-httplib2==0.1.0
81
+ google-auth-oauthlib==0.5.3
82
+ google-spreadsheet==0.0.6
83
+ googleapis-common-protos==1.56.4
84
+ graphviz==0.19.1
85
+ greenlet==1.1.3.post0
86
+ gspread==5.5.0
87
+ h11==0.12.0
88
+ h5py==3.6.0
89
+ hockey-rink==0.1.1
90
+ hockey-scraper==1.37.1
91
+ hockeyjockey==1.2
92
+ html2image==2.0.1
93
+ html5lib==1.1
94
+ htmltools==0.2.1
95
+ httpcore==0.15.0
96
+ httplib2==0.20.4
97
+ httpx==0.23.0
98
+ humanize==4.6.0
99
+ idna==2.10
100
+ image==1.5.33
101
+ imageio==2.15.0
102
+ imageio-ffmpeg==0.4.8
103
+ imgkit==1.2.2
104
+ immutables==0.19
105
+ importlib-metadata==6.0.0
106
+ importlib-resources==5.12.0
107
+ iniconfig==1.1.1
108
+ ipykernel==5.5.0
109
+ ipython==8.11.0
110
+ ipython-genutils==0.2.0
111
+ itsdangerous==2.1.2
112
+ jdcal==1.4.1
113
+ jedi==0.18.0
114
+ Jinja2==3.0.1
115
+ joblib==1.1.0
116
+ jsonschema==3.2.0
117
+ jupyter-client==6.1.11
118
+ jupyter-core==4.7.1
119
+ jupyterlab-pygments==0.1.2
120
+ kaleido==0.2.1
121
+ kiwisolver==1.3.1
122
+ libhockey==0.23.0
123
+ linkify-it-py==2.0.0
124
+ lxml==4.6.2
125
+ markdown-it-py==2.2.0
126
+ MarkupSafe==2.1.2
127
+ matplotlib==3.5.1
128
+ matplotlib-inline==0.1.6
129
+ mccabe==0.7.0
130
+ mdit-py-plugins==0.3.5
131
+ mdurl==0.1.2
132
+ menyou==1.0
133
+ meshio==5.3.4
134
+ meshplex==0.17.2
135
+ meshzoo==0.9.4
136
+ mistune==0.8.4
137
+ MLB-StatsAPI==1.4.2
138
+ more-itertools==8.12.0
139
+ moviepy==1.0.3
140
+ mpmath==1.2.1
141
+ multidict==6.0.2
142
+ munch==2.5.0
143
+ mysql-connector-python==8.0.24
144
+ natsort==7.1.1
145
+ nbclient==0.5.4
146
+ nbconvert==6.4.0
147
+ nbformat==5.1.3
148
+ ndim==0.1.6
149
+ nest-asyncio==1.5.1
150
+ networkx==2.6.3
151
+ nhl-logo-scraper==1.1.0
152
+ nhlpy==0.3.0
153
+ nibabel==3.2.2
154
+ notebook==6.4.4
155
+ npx==0.1.1
156
+ numpy==1.22.3
157
+ oauth2client==4.1.3
158
+ oauthlib==3.2.1
159
+ openpyxl==3.0.5
160
+ optimesh==0.8.7
161
+ orthopy==0.9.5
162
+ packaging==21.3
163
+ pandas==1.2.0
164
+ pandocfilters==1.5.0
165
+ parso==0.8.1
166
+ patsy==0.5.1
167
+ pbr==5.11.0
168
+ pdfkit==1.0.0
169
+ pickleshare==0.7.5
170
+ Pillow==9.0.1
171
+ pins==0.8.0
172
+ pip==23.1
173
+ platformdirs==2.5.1
174
+ plotly==4.1.1
175
+ pluggy==0.13.1
176
+ praw==7.7.0
177
+ prawcore==2.3.0
178
+ proglog==0.1.10
179
+ prometheus-client==0.11.0
180
+ prompt-toolkit==3.0.38
181
+ protobuf==4.21.6
182
+ psutil==5.9.3
183
+ pure-eval==0.2.2
184
+ py==1.10.0
185
+ pyaml==20.4.0
186
+ pyarrow==5.0.0
187
+ pyasn1==0.4.8
188
+ pyasn1-modules==0.2.8
189
+ pybaseball==2.2.1
190
+ pybind11==2.9.1
191
+ pycairo==1.23.0
192
+ pycodestyle==2.9.1
193
+ pycparser==2.20
194
+ pydantic==1.10.7
195
+ pyfiglet==0.8.post1
196
+ pyflakes==2.5.0
197
+ PyGithub==1.55
198
+ Pygments==2.8.0
199
+ pygsheets==2.0.5
200
+ PyHockeyStats==0.5.2
201
+ PyJWT==2.6.0
202
+ pymesh==1.0.2
203
+ PyNaCl==1.4.0
204
+ PyOpenGL==3.1.6
205
+ pyOpenSSL==22.1.0
206
+ pyparsing==3.0.7
207
+ pyperclip==1.8.2
208
+ pyproj==3.2.1
209
+ PyQt5==5.15.6
210
+ PyQt5-Qt5==5.15.2
211
+ PyQt5-sip==12.9.1
212
+ PyQtWebEngine==5.15.5
213
+ PyQtWebEngine-Qt5==5.15.2
214
+ pyrsistent==0.17.3
215
+ pytest==7.1.3
216
+ pytest_check==1.0.5
217
+ python-dateutil==2.8.2
218
+ python-dotenv==0.21.0
219
+ python-mlb-statsapi==0.3.9
220
+ python-multipart==0.0.6
221
+ pytools==2022.1.1
222
+ pytz==2022.7.1
223
+ PyVTK==0.5.18
224
+ PyWavelets==1.2.0
225
+ pywin32==305
226
+ pywinpty==1.1.4
227
+ PyYAML==5.3.1
228
+ pyzmq==25.0.1
229
+ quadpy==0.16.10
230
+ rauth==0.7.3
231
+ requests==2.28.1
232
+ requests-mock==1.10.0
233
+ requests-oauthlib==1.3.1
234
+ retrying==1.3.3
235
+ rfc3986==1.5.0
236
+ rhino-shapley-interop==0.0.4
237
+ rhino3dm==7.15.0
238
+ rich==12.0.0
239
+ riotwatcher==3.2.4
240
+ rsa==4.9
241
+ scikit-image==0.19.1
242
+ scikit-learn==1.0.1
243
+ scipy==1.6.0
244
+ seaborn==0.11.1
245
+ selenium==3.141.0
246
+ semver==2.13.0
247
+ Send2Trash==1.8.0
248
+ Shapely==1.7.1
249
+ shiny==0.3.0
250
+ six==1.16.0
251
+ sklearn==0.0
252
+ smmap==5.0.0
253
+ sniffio==1.3.0
254
+ soupsieve==2.4
255
+ spotipy==2.18.0
256
+ SQLAlchemy==1.4.42
257
+ sqlparse==0.4.2
258
+ stack-data==0.6.2
259
+ starlette==0.26.1
260
+ statsmodels==0.12.2
261
+ stevedore==4.1.1
262
+ stringcase==1.2.0
263
+ sympy==1.10
264
+ tabulate==0.9.0
265
+ tekore==4.5.0
266
+ tenacity==8.2.2
267
+ terminado==0.12.1
268
+ termplotlib==0.3.9
269
+ testpath==0.5.0
270
+ threadpoolctl==3.0.0
271
+ tifffile==2022.2.2
272
+ tinycss2==1.2.1
273
+ toml==0.10.2
274
+ tomli==2.0.1
275
+ toolz==0.11.2
276
+ TopDownHockey-Scraper==2.0.1
277
+ tornado==6.2
278
+ tqdm==4.62.3
279
+ traitlets==5.9.0
280
+ triangle==20220202
281
+ trimeshpy==0.0.2
282
+ tweepy==4.13.0
283
+ typing_extensions==4.5.0
284
+ tzdata==2022.2
285
+ uc-micro-py==1.0.1
286
+ Unidecode==1.3.4
287
+ update-checker==0.18.0
288
+ uritemplate==4.1.1
289
+ urllib3==1.26.15
290
+ uvicorn==0.21.1
291
+ vega-datasets==0.9.0
292
+ visvis==1.13.0
293
+ vtk==9.1.0
294
+ wcwidth==0.2.6
295
+ webdriver-manager==3.8.5
296
+ webencodings==0.5.1
297
+ websocket-client==1.5.1
298
+ websockets==11.0.1
299
+ Werkzeug==2.2.3
300
+ wget==3.2
301
+ wrapt==1.12.1
302
+ wslink==1.4.3
303
+ xmltodict==0.12.0
304
+ xxhash==3.2.0
305
+ yahoo-oauth==2.0
306
+ yarl==1.7.2
307
+ yffpy==2.11.0
308
+ yfpy==9.1.0
309
+ zipp==3.15.0
310
+ zope.interface==5.4.0