pybaseball icon indicating copy to clipboard operation
pybaseball copied to clipboard

Add team option for statcast batter & pitcher

Open nickbronson opened this issue 3 years ago • 3 comments

Add split_request_team() to utils.py, similar to split_request() but changed the player_id parameter to the 3 character team id. Added this to not break any existing functionality with split_request() in statcast_batter.py and statcast_pitcher.py.

Added statcast_batter_team() to statcast_batter.py to pull in all batters for a specified team during the time range. Similar to statcast_batter() but changed the player_id parameter to the 3 character team id.

Added statcast_pitcher_team() to statcast_pitcher.py to pull in all pitchers for a specified team during the time range. Similar to statcast_batter() but changed the player_id parameter to the 3 character team id.

nickbronson avatar Jun 08 '22 13:06 nickbronson

This seems reasonable to me. @TheCleric @tjburch if you guys agree, then let's add it, subject to adding unit tests for this

schorrm avatar Jun 20 '22 13:06 schorrm

Definitely like the idea, but I'm not sure I love introducing an all new function. We could introduce this as a new argument to the current statcast_batter function, defaulting to None and then make the asserts and scraping behavior based on which is not None. Thoughts? Feel free to override me if you disagree :)

tjburch avatar Jun 21 '22 02:06 tjburch

Agreed with Tyler

schorrm avatar Jun 22 '22 20:06 schorrm