import requests


def get_user_id_to_team_name(league_id):
    """
    Gets a map of fantasy player user id to their team name
    """
    user_id_to_team_name = {}
    r = requests.get("https://api.sleeper.app/v1/league/%s/users" % league_id)
    user_data = r.json()
    for user in user_data:
        user_id_to_team_name[user['user_id']] = user['display_name']
    return user_id_to_team_name