Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions pybaseball/team_batting.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ def team_batting_bref(team: str, start_season: int, end_season: Optional[int]=No
"""
if start_season is None:
raise ValueError(
"You need to provide at least one season to collect data for. Try team_batting_bref(season) or team_batting_bref(start_season, end_season)."
"You need to provide at least one season to collect data for. Try team_batting_bref(team, season) or team_batting_bref(team, start_season, end_season)."
)
if end_season is None:
end_season = start_season
if end_season < start_season:
raise ValueError(
"The end_season cannot be before the start_season."
)

url = "https://www.baseball-reference.com/teams/{}".format(team)
url = "https://www.baseball-reference.com/teams/{}".format(team.upper())

raw_data = []
headings: Optional[List[str]] = None
Expand Down
8 changes: 6 additions & 2 deletions pybaseball/team_fielding.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ def team_fielding_bref(team: str, start_season: int, end_season: Optional[int]=N
if start_season is None:
raise ValueError(
"You need to provide at least one season to collect data for. " +
"Try team_fielding_bref(season) or team_fielding_bref(start_season, end_season)."
"Try team_fielding_bref(team, season) or team_fielding_bref(team, start_season, end_season)."
)
if end_season is None:
end_season = start_season
if end_season < start_season:
raise ValueError(
"The end_season cannot be before the start_season."
)

url = "https://www.baseball-reference.com/teams/{}".format(team)
url = "https://www.baseball-reference.com/teams/{}".format(team.upper())

raw_data = []
headings: Optional[List[str]] = None
Expand Down
8 changes: 6 additions & 2 deletions pybaseball/team_pitching.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ def team_pitching_bref(team: str, start_season: int, end_season: Optional[int]=N
"""
if start_season is None:
raise ValueError(
"You need to provide at least one season to collect data for. Try team_pitching_bref(season) or team_pitching_bref(start_season, end_season)."
"You need to provide at least one season to collect data for. Try team_pitching_bref(team, season) or team_pitching_bref(team, start_season, end_season)."
)
if end_season is None:
end_season = start_season
if end_season < start_season:
raise ValueError(
"The end_season cannot be before the start_season."
)

url = "https://www.baseball-reference.com/teams/{}".format(team)
url = "https://www.baseball-reference.com/teams/{}".format(team.upper())

raw_data = []
headings: Optional[List[str]] = None
Expand Down