data

pybbda data module

some data, and blah

class pybbda.data.LahmanData(data_path=None)[source]
init(*args, **kwargs)
class pybbda.data.BaseballReferenceData(data_path=None)[source]
class pybbda.data.RetrosheetData(data_root=None)[source]
create_database()[source]
df_from_file(file_path)[source]
df_from_team_id(team_id)[source]
property engine
property event_files
init(*args, **kwargs)
initialize_table(df, conn=None)[source]
query(query)[source]
update_table(df, conn=None)[source]
class pybbda.data.FangraphsData(data_path=None)[source]
init(*args, **kwargs)
class pybbda.data.StatcastData(data_path=None)[source]
static convert_data_frame_types(df, data_type_mapping)[source]
get_statcast_daily(player_type, start_date, end_date, player_id='')[source]

Gets pitch level data from baseball savant query page. player_type can be batter or pitcher. The fetched data are the same but the player that the player_name column refers to is different. start_date and end_date are inclusive, for example to fetch data from 2019-05-01 only, set start_date = end_date = “2018-05-01”. If player_id is specified. then only data for pitches involving that player will be returned. The id here is the MLBAM player id which is an integer.

Parameters
  • player_type – str. can be batter or pitcher

  • start_date – str in %Y-%m-%d format

  • end_date – str in %Y-%m-%d format

  • player_id – str or int. mlbam player id

Returns

pandas data frame

init(*args, **kwargs)