Compare commits
2 commits
23cb006f23
...
2e3486c3f1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e3486c3f1 | ||
|
|
8877ebee47 |
23
app.py
23
app.py
|
|
@ -23,22 +23,19 @@ def extract_positional_data(lineup: list, position: str) -> int:
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
def extract_matchup_box_scores(league: League, week_override: int = None) -> dict:
|
def extract_matchup_box_scores(league: League, week_override: int) -> dict:
|
||||||
week_to_process = league.current_week
|
matchups = league.box_scores(week=week_override)
|
||||||
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_score': matchup.away_score,
|
'Away Team 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