How to use understat - 2 common examples

To help you get started, we’ve selected a few understat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vaastav / Fantasy-Premier-League / global_scraper.py View on Github external
id_players(base_filename + 'players_raw.csv', base_filename)
    player_ids = get_player_ids(base_filename)
    num_players = len(data["elements"])
    player_base_filename = base_filename + 'players/'
    gw_base_filename = base_filename + 'gws/'
    print("Extracting player specific data")
    for i,name in player_ids.items():
        player_data = get_individual_player_data(i)
        parse_player_history(player_data["history_past"], player_base_filename, name, i)
        parse_player_gw_history(player_data["history"], player_base_filename, name, i)
    if gw_num > 0:
        print("Collecting gw scores")
        collect_gw(gw_num, player_base_filename, gw_base_filename) 
        print("Merging gw scores")
        merge_gw(gw_num, gw_base_filename)
    parse_epl_data(base_filename)
github amosbastian / FPLbot / FPLbot / utils.py View on Github external
async def update_results():
    async with aiohttp.ClientSession() as session:
        understat = Understat(session)
        results = await understat.get_league_results("EPL", 2019)
        for result in results:
            result["h"]["title"] = understat_team_converter(result["h"]["title"])
            result["a"]["title"] = understat_team_converter(result["a"]["title"])

    requests = [ReplaceOne({"id": result["id"]}, result, upsert=True)
                for result in results]
    database.results.bulk_write(requests)

understat

A Python wrapper for https://understat.com/

MIT
Latest version published 11 months ago

Package Health Score

55 / 100
Full package analysis

Similar packages