Happy Wheels API包装
hwapi的Python项目详细描述
Hwapi:Happy Wheels API包装器
安装
要求:Python3.6+
pip(3) install git+https://github.com/kittenswolf/hwapi.git
pip(3) install -r requirements.txt
用法(异步)
importasyncioimporthwapiclient=hwapi.client(useragent="test")asyncdeftest():jim=awaitclient.user(2)asyncforlevelinjim.levels("newest","anytime"):print("Replays for Jim's level '{}':".format(level.name))asyncforreplayinlevel.replays("completion_time"):print(" ID: {} - time: {}".format(replay.id,replay.completion_time))featured_levels=awaitclient.featured_levels()print("There are {} featured levels.".format(len(featured_levels)))asyncforlevelinclient.levels("newest","anytime"):user_location=awaitlevel.author.location()user_joined=awaitlevel.author.date_joined()print("{}'s author: {} location: {}, date joined: {}".format(level.name,level.author.name,user_location,user_joined))loop=asyncio.get_event_loop()loop.run_until_complete(test())