Inactive. Check the network graph to see if there are any active forks. Thanks for using srcomapi.
A Python 3 implementation of the speedrun.com REST API. pip3 install srcomapi
Does not support Python 2. Sorry.
>>>importsrcomapi, srcomapi.datatypesasdt>>>api=srcomapi.SpeedrunCom(); api.debug=1# It's recommended to cache the game ID and use it for future requests.# Data is cached for the current session by classname/id so future# requests for the same game are instantaneous.>>>api.search(srcomapi.datatypes.Game, {"name": "super mario sunshine"})
[<Game"Super Mario Sunshine">]
>>>game= _[0]>>>game.categories
[<Category"Any%">, ...]
>>> _[0].records[0].runs
[{'run': <Run<Game"Super Mario Sunshine">/<Category"Any%">/9mr570dy4498>, 'place': 1}, ...]
>>> _[0]["run"].times
{'primary_t': 4498, ...}
# primary_t is the time in secondssms_runs= {}
forcategoryingame.categories:
ifnotcategory.nameinsms_runs:
sms_runs[category.name] = {}
ifcategory.type=='per-level':
forlevelingame.levels:
sms_runs[category.name][level.name] =dt.Leaderboard(api, data=api.get("leaderboards/{}/level/{}/{}?embed=variables".format(game.id, level.id, category.id)))
else:
sms_runs[category.name] =dt.Leaderboard(api, data=api.get("leaderboards/{}/category/{}?embed=variables".format(game.id, category.id)))