Lookup Functions

Player

lookup.lookup_player(player_name, school):

A function to find a player’s id from their name and school

Player_name (str):

name of player to lookup

School:

the name of the player’s school (str) or school_id (int)

Returns (int):

player_id

Examples:

lookup_player(“Jake Gelof”, “Virginia”) >>> 2486499

lookup.lookup_player_reverse(player_id):

A function to find a player’s name and school from their player_id

Player_id (str):

name of player to lookup

Season (int):

YYYY

Returns (tuple):

of player_name (str), school_name (str), school_id (int)

lookup_seasons_played(stats_player_seq):

A function to find the final and debut seasons of a given player

Stats_player_seq (int):

NCAA player_id

Returns (tuple(int)):

of debut season, most recent season

School

lookup.lookup_school(school_name):

A function to find a school’s id from it’s name

School (str):

the name of the school

Returns (int):

school_id

Examples:

lookup_school(“cornell”) >>> 167

lookup.lookup_school_reverse(school_id):

A function to find a school’s name from a school_id

School_id (int):

Returns (str):

the name of the school

Examples:

lookup_school_reverse(167) >>> “Cornell”

Season

lookup_season_id(season):

A function that finds the year_stat_category_ids for a given season

Season (int):

YYYY

Returns (int):

season_id

lookup.lookup_season_ids(season):

A function that finds the year_stat_category_ids of a given season

Season (int):

YYYY

Returns:

tuple of season_id, batting_id, pitching_id

lookup_season_reverse(season_id):

A function that finds the year_stat_category_ids and season of a season_id

Season_id (int):

NCAA season_id

Returns (tuple):

of season_id, batting_id, pitching_id