import pickle


def get_teams_pitchers(team, year):
    """Returns a list of player ids for a specified team abbrivation and year"""

    path = "Pitch-Predict/pitcher_team_dicts/" + str(year) + '_pitcher_team_dict.pkl'
    pitcher_team_dict = pickle.load(open(path, 'rb'))

    pitchers = []
    for id, player_info in pitcher_team_dict.items():
        if player_info['player_team'] == team:
            pitchers.append(id)

    return pitchers