Compare commits
No commits in common. "2e3486c3f13b6ec0e0d94ebe3b8e683ef717dc4f" and "23cb006f23b24ede3900c5a87c1578123129e7a6" have entirely different histories.
2e3486c3f1
...
23cb006f23
23
app.py
23
app.py
|
|
@ -23,19 +23,22 @@ def extract_positional_data(lineup: list, position: str) -> int:
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
def extract_matchup_box_scores(league: League, week_override: int) -> dict:
|
def extract_matchup_box_scores(league: League, week_override: int = None) -> dict:
|
||||||
matchups = league.box_scores(week=week_override)
|
week_to_process = league.current_week
|
||||||
|
if week_override:
|
||||||
|
week_to_process = week_override
|
||||||
|
matchups = league.box_scores(week=week_to_process)
|
||||||
result = []
|
result = []
|
||||||
for matchup in matchups:
|
for matchup in matchups:
|
||||||
result.append({
|
result.append({
|
||||||
'Away Team': matchup.away_team.team_name,
|
'away_team': matchup.away_team.team_name,
|
||||||
'Away Team Score': matchup.away_score,
|
'away_score': matchup.away_score,
|
||||||
'Away Team Kicker Score': extract_positional_data(matchup.away_lineup, 'K'),
|
'away_team_kicker_score': extract_positional_data(matchup.away_lineup, 'K'),
|
||||||
'Away Team Bench Score': extract_positional_data(matchup.away_lineup, 'BE'),
|
'away_team_bench_score': extract_positional_data(matchup.away_lineup, 'BE'),
|
||||||
'Home Team': matchup.home_team.team_name,
|
'home_team': matchup.home_team.team_name,
|
||||||
'Home Team Score': matchup.home_score,
|
'home_team_score': matchup.home_score,
|
||||||
'Home Team Kicker Score': extract_positional_data(matchup.home_lineup, 'K'),
|
'home_team_kicker_score': extract_positional_data(matchup.home_lineup, 'K'),
|
||||||
'Home Team Bench Score': extract_positional_data(matchup.home_lineup, 'BE')
|
'home_team_bench_score': extract_positional_data(matchup.home_lineup, 'BE')
|
||||||
})
|
})
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue