James McCool
commited on
Commit
Β·
ab3e05f
1
Parent(s):
47184c3
replaced discord calls with writes
Browse files- src/streamlit_app.py +27 -27
src/streamlit_app.py
CHANGED
|
@@ -21,10 +21,6 @@ from datetime import datetime, date
|
|
| 21 |
from pytz import timezone as pytz_timezone
|
| 22 |
|
| 23 |
from database import *
|
| 24 |
-
from sports.nhl_functions import *
|
| 25 |
-
from sports.nfl_functions import *
|
| 26 |
-
from sports.nba_functions import *
|
| 27 |
-
from sports.mlb_functions import *
|
| 28 |
|
| 29 |
pd_options.mode.chained_assignment = None # default='warn'
|
| 30 |
from warnings import simplefilter
|
|
@@ -63,6 +59,7 @@ selected_tab = st.segmented_control(
|
|
| 63 |
|
| 64 |
# Main content area
|
| 65 |
if selected_tab == "NHL Updates":
|
|
|
|
| 66 |
|
| 67 |
if st.button(f"π Update NHL models and generate seed frames", type="primary", use_container_width=True):
|
| 68 |
|
|
@@ -70,7 +67,7 @@ if selected_tab == "NHL Updates":
|
|
| 70 |
build_prop_betting_table(nhl_db)
|
| 71 |
|
| 72 |
try:
|
| 73 |
-
|
| 74 |
except:
|
| 75 |
pass
|
| 76 |
|
|
@@ -78,7 +75,7 @@ if selected_tab == "NHL Updates":
|
|
| 78 |
roo_file, own_dicts = build_dk_player_level_basic_outcomes(slate_info, dk_player_hold, fd_player_hold, nhl_db)
|
| 79 |
|
| 80 |
try:
|
| 81 |
-
|
| 82 |
except:
|
| 83 |
pass
|
| 84 |
|
|
@@ -117,7 +114,7 @@ if selected_tab == "NHL Updates":
|
|
| 117 |
time_sleep(1)
|
| 118 |
|
| 119 |
try:
|
| 120 |
-
|
| 121 |
except:
|
| 122 |
pass
|
| 123 |
|
|
@@ -144,7 +141,7 @@ if selected_tab == "NHL Updates":
|
|
| 144 |
time_sleep(1)
|
| 145 |
|
| 146 |
try:
|
| 147 |
-
|
| 148 |
except:
|
| 149 |
pass
|
| 150 |
|
|
@@ -216,7 +213,7 @@ if selected_tab == "NHL Updates":
|
|
| 216 |
DK_NHL_seed_frame(nhl_db, roo_file)
|
| 217 |
|
| 218 |
try:
|
| 219 |
-
|
| 220 |
except:
|
| 221 |
pass
|
| 222 |
|
|
@@ -226,7 +223,7 @@ if selected_tab == "NHL Updates":
|
|
| 226 |
FD_NHL_seed_frame(nhl_db, roo_file)
|
| 227 |
|
| 228 |
try:
|
| 229 |
-
|
| 230 |
except:
|
| 231 |
pass
|
| 232 |
|
|
@@ -234,10 +231,12 @@ if selected_tab == "NHL Updates":
|
|
| 234 |
st.balloons()
|
| 235 |
|
| 236 |
if selected_tab == "NFL Updates":
|
|
|
|
| 237 |
st.info("NFL updates coming soon!")
|
| 238 |
st.write("NFL functionality will be added later on.")
|
| 239 |
|
| 240 |
if selected_tab == "NBA Updates":
|
|
|
|
| 241 |
|
| 242 |
if st.button(f"π Update NBA models and generate seed frames", type="primary", use_container_width=True):
|
| 243 |
x: int = 1
|
|
@@ -341,12 +340,12 @@ if selected_tab == "NBA Updates":
|
|
| 341 |
|
| 342 |
if ROO_creation_var == 1:
|
| 343 |
try:
|
| 344 |
-
|
| 345 |
except:
|
| 346 |
pass
|
| 347 |
else:
|
| 348 |
try:
|
| 349 |
-
|
| 350 |
except:
|
| 351 |
pass
|
| 352 |
|
|
@@ -354,25 +353,25 @@ if selected_tab == "NBA Updates":
|
|
| 354 |
|
| 355 |
upload_dfs_data(client, roo_final)
|
| 356 |
try:
|
| 357 |
-
|
| 358 |
except:
|
| 359 |
pass
|
| 360 |
|
| 361 |
upload_betting_data(client)
|
| 362 |
try:
|
| 363 |
-
|
| 364 |
except:
|
| 365 |
pass
|
| 366 |
|
| 367 |
try:
|
| 368 |
trending_script()
|
| 369 |
try:
|
| 370 |
-
|
| 371 |
except:
|
| 372 |
pass
|
| 373 |
except:
|
| 374 |
try:
|
| 375 |
-
|
| 376 |
except:
|
| 377 |
pass
|
| 378 |
|
|
@@ -382,12 +381,12 @@ if selected_tab == "NBA Updates":
|
|
| 382 |
|
| 383 |
if DK_seed_frame_var == 1:
|
| 384 |
try:
|
| 385 |
-
|
| 386 |
except:
|
| 387 |
pass
|
| 388 |
else:
|
| 389 |
try:
|
| 390 |
-
|
| 391 |
except:
|
| 392 |
pass
|
| 393 |
|
|
@@ -399,12 +398,12 @@ if selected_tab == "NBA Updates":
|
|
| 399 |
|
| 400 |
if FD_seed_frame_var == 1:
|
| 401 |
try:
|
| 402 |
-
|
| 403 |
except:
|
| 404 |
pass
|
| 405 |
else:
|
| 406 |
try:
|
| 407 |
-
|
| 408 |
except:
|
| 409 |
pass
|
| 410 |
|
|
@@ -438,12 +437,12 @@ if selected_tab == "NBA Updates":
|
|
| 438 |
|
| 439 |
if ROO_creation_var == 1:
|
| 440 |
try:
|
| 441 |
-
|
| 442 |
except:
|
| 443 |
pass
|
| 444 |
else:
|
| 445 |
try:
|
| 446 |
-
|
| 447 |
except:
|
| 448 |
pass
|
| 449 |
|
|
@@ -455,12 +454,12 @@ if selected_tab == "NBA Updates":
|
|
| 455 |
|
| 456 |
if DK_SD_seed_frame_var == 1:
|
| 457 |
try:
|
| 458 |
-
|
| 459 |
except:
|
| 460 |
pass
|
| 461 |
else:
|
| 462 |
try:
|
| 463 |
-
|
| 464 |
except:
|
| 465 |
pass
|
| 466 |
|
|
@@ -472,12 +471,12 @@ if selected_tab == "NBA Updates":
|
|
| 472 |
|
| 473 |
if FD_SD_seed_frame_var == 1:
|
| 474 |
try:
|
| 475 |
-
|
| 476 |
except:
|
| 477 |
pass
|
| 478 |
else:
|
| 479 |
try:
|
| 480 |
-
|
| 481 |
except:
|
| 482 |
pass
|
| 483 |
|
|
@@ -485,7 +484,7 @@ if selected_tab == "NBA Updates":
|
|
| 485 |
|
| 486 |
upload_sd_dfs_data(client, sd_roo_final)
|
| 487 |
try:
|
| 488 |
-
|
| 489 |
except:
|
| 490 |
pass
|
| 491 |
|
|
@@ -500,5 +499,6 @@ if selected_tab == "NBA Updates":
|
|
| 500 |
st.balloons()
|
| 501 |
|
| 502 |
if selected_tab == "MLB Updates":
|
|
|
|
| 503 |
st.info("MLB updates coming soon!")
|
| 504 |
st.write("MLB functionality will be added later on.")
|
|
|
|
| 21 |
from pytz import timezone as pytz_timezone
|
| 22 |
|
| 23 |
from database import *
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
pd_options.mode.chained_assignment = None # default='warn'
|
| 26 |
from warnings import simplefilter
|
|
|
|
| 59 |
|
| 60 |
# Main content area
|
| 61 |
if selected_tab == "NHL Updates":
|
| 62 |
+
from sports.nhl_functions import *
|
| 63 |
|
| 64 |
if st.button(f"π Update NHL models and generate seed frames", type="primary", use_container_width=True):
|
| 65 |
|
|
|
|
| 67 |
build_prop_betting_table(nhl_db)
|
| 68 |
|
| 69 |
try:
|
| 70 |
+
st.write(content="NHL Prop Betting Table refreshed")
|
| 71 |
except:
|
| 72 |
pass
|
| 73 |
|
|
|
|
| 75 |
roo_file, own_dicts = build_dk_player_level_basic_outcomes(slate_info, dk_player_hold, fd_player_hold, nhl_db)
|
| 76 |
|
| 77 |
try:
|
| 78 |
+
st.write(content="NHL Draftkings Player Level ROO refreshed")
|
| 79 |
except:
|
| 80 |
pass
|
| 81 |
|
|
|
|
| 114 |
time_sleep(1)
|
| 115 |
|
| 116 |
try:
|
| 117 |
+
st.write(content="NHL Stack Matrix refreshed")
|
| 118 |
except:
|
| 119 |
pass
|
| 120 |
|
|
|
|
| 141 |
time_sleep(1)
|
| 142 |
|
| 143 |
try:
|
| 144 |
+
st.write(content="NHL Powerplay Stack Matrix refreshed")
|
| 145 |
except:
|
| 146 |
pass
|
| 147 |
|
|
|
|
| 213 |
DK_NHL_seed_frame(nhl_db, roo_file)
|
| 214 |
|
| 215 |
try:
|
| 216 |
+
st.write(content="NHL Draftkings Seed Frames refreshed")
|
| 217 |
except:
|
| 218 |
pass
|
| 219 |
|
|
|
|
| 223 |
FD_NHL_seed_frame(nhl_db, roo_file)
|
| 224 |
|
| 225 |
try:
|
| 226 |
+
st.write(content="NHL Fanduel Seed Frames refreshed")
|
| 227 |
except:
|
| 228 |
pass
|
| 229 |
|
|
|
|
| 231 |
st.balloons()
|
| 232 |
|
| 233 |
if selected_tab == "NFL Updates":
|
| 234 |
+
from sports.nfl_functions import *
|
| 235 |
st.info("NFL updates coming soon!")
|
| 236 |
st.write("NFL functionality will be added later on.")
|
| 237 |
|
| 238 |
if selected_tab == "NBA Updates":
|
| 239 |
+
from sports.nba_functions import *
|
| 240 |
|
| 241 |
if st.button(f"π Update NBA models and generate seed frames", type="primary", use_container_width=True):
|
| 242 |
x: int = 1
|
|
|
|
| 340 |
|
| 341 |
if ROO_creation_var == 1:
|
| 342 |
try:
|
| 343 |
+
st.write(content="NBA ROO structure refreshed")
|
| 344 |
except:
|
| 345 |
pass
|
| 346 |
else:
|
| 347 |
try:
|
| 348 |
+
st.write(content="NBA ROO structure script broke")
|
| 349 |
except:
|
| 350 |
pass
|
| 351 |
|
|
|
|
| 353 |
|
| 354 |
upload_dfs_data(client, roo_final)
|
| 355 |
try:
|
| 356 |
+
st.write(content="NBA DFS database refreshed")
|
| 357 |
except:
|
| 358 |
pass
|
| 359 |
|
| 360 |
upload_betting_data(client)
|
| 361 |
try:
|
| 362 |
+
st.write(content="NBA betting database refreshed")
|
| 363 |
except:
|
| 364 |
pass
|
| 365 |
|
| 366 |
try:
|
| 367 |
trending_script()
|
| 368 |
try:
|
| 369 |
+
st.write(content="NBA Trending Tables refreshed")
|
| 370 |
except:
|
| 371 |
pass
|
| 372 |
except:
|
| 373 |
try:
|
| 374 |
+
st.write(content="NBA Trending Tables broke")
|
| 375 |
except:
|
| 376 |
pass
|
| 377 |
|
|
|
|
| 381 |
|
| 382 |
if DK_seed_frame_var == 1:
|
| 383 |
try:
|
| 384 |
+
st.write(content="NBA Draftkings Seed Frames refreshed")
|
| 385 |
except:
|
| 386 |
pass
|
| 387 |
else:
|
| 388 |
try:
|
| 389 |
+
st.write(content="NBA Draftkings Seed Frames script broke")
|
| 390 |
except:
|
| 391 |
pass
|
| 392 |
|
|
|
|
| 398 |
|
| 399 |
if FD_seed_frame_var == 1:
|
| 400 |
try:
|
| 401 |
+
st.write(content="NBA Fanduel Seed Frames refreshed")
|
| 402 |
except:
|
| 403 |
pass
|
| 404 |
else:
|
| 405 |
try:
|
| 406 |
+
st.write(content="NBA Fanduel Seed Frames script broke")
|
| 407 |
except:
|
| 408 |
pass
|
| 409 |
|
|
|
|
| 437 |
|
| 438 |
if ROO_creation_var == 1:
|
| 439 |
try:
|
| 440 |
+
st.write(content="NBA SD ROO structure refreshed")
|
| 441 |
except:
|
| 442 |
pass
|
| 443 |
else:
|
| 444 |
try:
|
| 445 |
+
st.write(content="NBA SD ROO structure script broke")
|
| 446 |
except:
|
| 447 |
pass
|
| 448 |
|
|
|
|
| 454 |
|
| 455 |
if DK_SD_seed_frame_var == 1:
|
| 456 |
try:
|
| 457 |
+
st.write(content="NBA Draftkings SD Seed Frames refreshed")
|
| 458 |
except:
|
| 459 |
pass
|
| 460 |
else:
|
| 461 |
try:
|
| 462 |
+
st.write(content="NBA Draftkings SD Seed Frames script broke")
|
| 463 |
except:
|
| 464 |
pass
|
| 465 |
|
|
|
|
| 471 |
|
| 472 |
if FD_SD_seed_frame_var == 1:
|
| 473 |
try:
|
| 474 |
+
st.write(content="NBA Fanduel SD Seed Frames refreshed")
|
| 475 |
except:
|
| 476 |
pass
|
| 477 |
else:
|
| 478 |
try:
|
| 479 |
+
st.write(content="NBA Fanduel SD Seed Frames script broke")
|
| 480 |
except:
|
| 481 |
pass
|
| 482 |
|
|
|
|
| 484 |
|
| 485 |
upload_sd_dfs_data(client, sd_roo_final)
|
| 486 |
try:
|
| 487 |
+
st.write(content="NBA SD DFS database refreshed")
|
| 488 |
except:
|
| 489 |
pass
|
| 490 |
|
|
|
|
| 499 |
st.balloons()
|
| 500 |
|
| 501 |
if selected_tab == "MLB Updates":
|
| 502 |
+
from sports.mlb_functions import *
|
| 503 |
st.info("MLB updates coming soon!")
|
| 504 |
st.write("MLB functionality will be added later on.")
|