James McCool
commited on
Commit
·
01bf9da
1
Parent(s):
f2f92fc
Update salary retrieval functions to use 'Date' field instead of 'Contest Date' for querying player information, ensuring accurate data retrieval across NFL, NBA, MLB, and NHL functions.
Browse files
app.py
CHANGED
|
@@ -131,7 +131,7 @@ st.markdown("""
|
|
| 131 |
def grab_nfl_reg_salaries(slate_var: str):
|
| 132 |
collection = salaries_db["NFL_reg_player_info"]
|
| 133 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 134 |
-
records = pd.DataFrame(list(collection.find({'
|
| 135 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 136 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 137 |
if slate_var == 'Main':
|
|
@@ -164,7 +164,7 @@ def grab_nfl_reg_salaries(slate_var: str):
|
|
| 164 |
def grab_nfl_showdown_salaries():
|
| 165 |
collection = salaries_db["NFL_showdown_player_info"]
|
| 166 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 167 |
-
records = pd.DataFrame(list(collection.find({'
|
| 168 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 169 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 170 |
return records
|
|
@@ -172,7 +172,7 @@ def grab_nfl_showdown_salaries():
|
|
| 172 |
def grab_nba_reg_salaries(slate_var: str):
|
| 173 |
collection = salaries_db["NBA_reg_player_info"]
|
| 174 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 175 |
-
records = pd.DataFrame(list(collection.find({'
|
| 176 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 177 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 178 |
if slate_var == 'Main':
|
|
@@ -205,7 +205,7 @@ def grab_nba_reg_salaries(slate_var: str):
|
|
| 205 |
def grab_nba_showdown_salaries():
|
| 206 |
collection = salaries_db["NBA_showdown_player_info"]
|
| 207 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 208 |
-
records = pd.DataFrame(list(collection.find({'
|
| 209 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 210 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 211 |
return records
|
|
@@ -213,7 +213,7 @@ def grab_nba_showdown_salaries():
|
|
| 213 |
def grab_mlb_reg_salaries(slate_var: str):
|
| 214 |
collection = salaries_db["MLB_reg_player_info"]
|
| 215 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 216 |
-
records = pd.DataFrame(list(collection.find({'
|
| 217 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 218 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 219 |
if slate_var == 'Main':
|
|
@@ -246,7 +246,7 @@ def grab_mlb_reg_salaries(slate_var: str):
|
|
| 246 |
def grab_mlb_showdown_salaries():
|
| 247 |
collection = salaries_db["MLB_showdown_player_info"]
|
| 248 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 249 |
-
records = pd.DataFrame(list(collection.find({'
|
| 250 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 251 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 252 |
return records
|
|
@@ -254,7 +254,7 @@ def grab_mlb_showdown_salaries():
|
|
| 254 |
def grab_nhl_reg_salaries(slate_var: str):
|
| 255 |
collection = salaries_db["NHL_reg_player_info"]
|
| 256 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 257 |
-
records = pd.DataFrame(list(collection.find({'
|
| 258 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 259 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 260 |
if slate_var == 'Main':
|
|
@@ -287,7 +287,7 @@ def grab_nhl_reg_salaries(slate_var: str):
|
|
| 287 |
def grab_nhl_showdown_salaries():
|
| 288 |
collection = salaries_db["NHL_showdown_player_info"]
|
| 289 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 290 |
-
records = pd.DataFrame(list(collection.find({'
|
| 291 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 292 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 293 |
return records
|
|
|
|
| 131 |
def grab_nfl_reg_salaries(slate_var: str):
|
| 132 |
collection = salaries_db["NFL_reg_player_info"]
|
| 133 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 134 |
+
records = pd.DataFrame(list(collection.find({'Date': {'$gte': today_str}})))
|
| 135 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 136 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 137 |
if slate_var == 'Main':
|
|
|
|
| 164 |
def grab_nfl_showdown_salaries():
|
| 165 |
collection = salaries_db["NFL_showdown_player_info"]
|
| 166 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 167 |
+
records = pd.DataFrame(list(collection.find({'Date': {'$gte': today_str}})))
|
| 168 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 169 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 170 |
return records
|
|
|
|
| 172 |
def grab_nba_reg_salaries(slate_var: str):
|
| 173 |
collection = salaries_db["NBA_reg_player_info"]
|
| 174 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 175 |
+
records = pd.DataFrame(list(collection.find({'Date': {'$gte': today_str}})))
|
| 176 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 177 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 178 |
if slate_var == 'Main':
|
|
|
|
| 205 |
def grab_nba_showdown_salaries():
|
| 206 |
collection = salaries_db["NBA_showdown_player_info"]
|
| 207 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 208 |
+
records = pd.DataFrame(list(collection.find({'Date': {'$gte': today_str}})))
|
| 209 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 210 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 211 |
return records
|
|
|
|
| 213 |
def grab_mlb_reg_salaries(slate_var: str):
|
| 214 |
collection = salaries_db["MLB_reg_player_info"]
|
| 215 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 216 |
+
records = pd.DataFrame(list(collection.find({'Date': {'$gte': today_str}})))
|
| 217 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 218 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 219 |
if slate_var == 'Main':
|
|
|
|
| 246 |
def grab_mlb_showdown_salaries():
|
| 247 |
collection = salaries_db["MLB_showdown_player_info"]
|
| 248 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 249 |
+
records = pd.DataFrame(list(collection.find({'Date': {'$gte': today_str}})))
|
| 250 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 251 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 252 |
return records
|
|
|
|
| 254 |
def grab_nhl_reg_salaries(slate_var: str):
|
| 255 |
collection = salaries_db["NHL_reg_player_info"]
|
| 256 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 257 |
+
records = pd.DataFrame(list(collection.find({'Date': {'$gte': today_str}})))
|
| 258 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 259 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 260 |
if slate_var == 'Main':
|
|
|
|
| 287 |
def grab_nhl_showdown_salaries():
|
| 288 |
collection = salaries_db["NHL_showdown_player_info"]
|
| 289 |
today_str = datetime.now().strftime("%Y%m%d")
|
| 290 |
+
records = pd.DataFrame(list(collection.find({'Date': {'$gte': today_str}})))
|
| 291 |
records = records[['Display Name', 'draftableId', 'Position', 'Salary']]
|
| 292 |
records = records.rename(columns={'Display Name': 'Name', 'draftableId': 'ID', 'Position': 'Roster Position'})
|
| 293 |
return records
|