zwift移动api客户端。
zwift-client的Python项目详细描述
zwift移动api客户端
用python编写的zwift移动api客户端。深受zwift-mobile-api启发。
安装
$ pip install zwift-client
使用量
客户机
>>> from zwift import Client >>> username = 'your-username' >>> password = 'your-password' >>> player_id = your-player-id >>> client = Client(username, password)
剖面图
>>> profile = client.get_profile() >>> profile.profile # fetch your profile data >>> profile.followers >>> profile.followees >>> profile.get_activities() # metadata of your activities >>> profile.latest_activity # metadata of your latest activity
活动
>>> activity = client.get_activity(player_id) >>> activities = activity.list() # your activities (default start is 0, default limit is 20) >>> activities = activity.list(start=20, limit=50) >>> latest_activity_id = activities[0]['id'] >>> activity.get_activity(latest_activity_id) # metadata of your latest activity >>> activity.get_data(latest_activity_id) # processed FIT file data
世界
>>> world = client.get_world(1) # get world with id 1 >>> world.players # players currently present in this world >>> world.player_status(player_id) # current player status information like speed, cadence, power, etc.
学分
这个包是用cookiecutter和audreyr/cookiecutter-pypackage项目模板创建的。
历史记录
0.2.0(2018-03-02)
- 将可选的start和limit关键字参数添加到Activity.list()。
0.1.0(2018-01-14)
- 初次发布。