Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a weekly game lines feed to the python API #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ohmysportsfeedspy/v2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def __init__(self, verbose, store_type=None, store_location=None):
'seasonal_standings',
'seasonal_game_lines',
'daily_game_lines',
'weekly_game_lines',
'daily_futures'
]

Expand Down Expand Up @@ -240,6 +241,16 @@ def determine_url(self, league, season, feed, output_format, params):
return "{base_url}/{league}/{season}/date/{date}/odds_gamelines.{output}".format(base_url=self.base_url, league=league,
season=season, date=params["date"], output=output_format)

elif feed == "weekly_game_lines":
if season == "":
raise AssertionError("You must specify a season for this request")
if not "week" in params:
raise AssertionError("You must specify a 'week' param for this request.")
if league != "nfl":
raise AssertionError("weekly_game_lines feed type only avaiable for the NFL")
week = params['week']
return f"{self.base_url}/{league}/{season}/week/{week}/odds_gamelines.{output_format}"

elif feed == "daily_futures":
if season == "":
raise AssertionError("You must specify a season for this request.")
Expand Down