Multichem commited on
Commit
41b51c7
·
verified ·
1 Parent(s): c569ef8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -3,7 +3,6 @@ st.set_page_config(layout="wide")
3
  import numpy as np
4
  import pandas as pd
5
  import gspread
6
- import pymongo
7
  import streamlit as st
8
  from itertools import combinations
9
 
@@ -23,17 +22,14 @@ def init_conn():
23
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
24
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/gspread-connection%40model-sheets-connect.iam.gserviceaccount.com"
25
  }
26
- uri = "mongodb+srv://multichem:[email protected]/?retryWrites=true&w=majority&appName=TestCluster"
27
- client = pymongo.MongoClient(uri, retryWrites=True, serverSelectionTimeoutMS=500000)
28
- db = client["testing_db"]
29
 
30
- MLB_Data = 'https://docs.google.com/spreadsheets/d/1f42Ergav8K1VsOLOK9MUn7DM_MLMvv4GR2Fy7EfnZTc/edit#gid=340831852'
31
 
32
  gc_con = gspread.service_account_from_dict(credentials, scope)
33
 
34
- return gc_con, db, MLB_Data
35
 
36
- gc, db, MLB_Data = init_conn()
37
 
38
  game_format = {'Win Percentage': '{:.2%}','First Inning Lead Percentage': '{:.2%}',
39
  'Fifth Inning Lead Percentage': '{:.2%}', '8+ runs': '{:.2%}', 'DK LevX': '{:.2%}', 'FD LevX': '{:.2%}'}
@@ -41,8 +37,6 @@ game_format = {'Win Percentage': '{:.2%}','First Inning Lead Percentage': '{:.2%
41
  player_roo_format = {'Top_finish': '{:.2%}','Top_5_finish': '{:.2%}', 'Top_10_finish': '{:.2%}', '20+%': '{:.2%}', '2x%': '{:.2%}', '3x%': '{:.2%}',
42
  '4x%': '{:.2%}','GPP%': '{:.2%}'}
43
 
44
- all_dk_player_projections = 'https://docs.google.com/spreadsheets/d/1I_1Ve3F4tftgfLQQoRKOJ351XfEG48s36OxXUKxmgS8/edit#gid=1391856348'
45
-
46
  @st.cache_data(ttl = 599)
47
  def init_baselines():
48
  sh = gc.open_by_url(all_dk_player_projections)
 
3
  import numpy as np
4
  import pandas as pd
5
  import gspread
 
6
  import streamlit as st
7
  from itertools import combinations
8
 
 
22
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
23
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/gspread-connection%40model-sheets-connect.iam.gserviceaccount.com"
24
  }
 
 
 
25
 
26
+ NFL_Data = 'https://docs.google.com/spreadsheets/d/1I_1Ve3F4tftgfLQQoRKOJ351XfEG48s36OxXUKxmgS8/edit?gid=694077504#gid=694077504'
27
 
28
  gc_con = gspread.service_account_from_dict(credentials, scope)
29
 
30
+ return gc_con, NFL_Data
31
 
32
+ gc, all_dk_player_projections = init_conn()
33
 
34
  game_format = {'Win Percentage': '{:.2%}','First Inning Lead Percentage': '{:.2%}',
35
  'Fifth Inning Lead Percentage': '{:.2%}', '8+ runs': '{:.2%}', 'DK LevX': '{:.2%}', 'FD LevX': '{:.2%}'}
 
37
  player_roo_format = {'Top_finish': '{:.2%}','Top_5_finish': '{:.2%}', 'Top_10_finish': '{:.2%}', '20+%': '{:.2%}', '2x%': '{:.2%}', '3x%': '{:.2%}',
38
  '4x%': '{:.2%}','GPP%': '{:.2%}'}
39
 
 
 
40
  @st.cache_data(ttl = 599)
41
  def init_baselines():
42
  sh = gc.open_by_url(all_dk_player_projections)