Exemplo n.º 1
0
def request_stats_categories():

    access_token = session.get('access_token')
    r = yahoo.get_stats_categories(access_token)
    #pprint(r.text)

    return jsonify(json_util.parse("fantasy_content.game[1].stat_categories" , r.json()))
Exemplo n.º 2
0
def create_league():
    access_token = session.get('access_token')
    league_type = request.args.get('league_type', 'nba', type=str)
    league_key = request.args.get('league_key', '', type=str)

    stats_data = yahoo.get_stats_categories(access_token, league_type)
    teams_data = yahoo.get_teams(access_token, league_key)

    league = League()
    league.parseStats(stats_data)
    league.parseTeams(teams_data)