smashrun api的python客户端

smashrun-client的Python项目详细描述


https://travis-ci.org/campbellr/smashrun-client.svg?branch=master

用于Smashrunapi的python客户端。

安装

您可以使用pip

pip install --pre smashrun-client

用法

认证

使用现有刷新令牌

client=Smashrun(client_id='my_client_id',client_secret='my_secret')client.refresh_token(refresh_token='my_refresh_token')

请求令牌
# use urn:ietf:wg:oauth:2.0:oob for applications that aren't a web appclient=Smashrun(client_id='my_client_id',client_secret='my_secret',redirect_uri='urn:ietf:wg:oauth:2.0:auto')auth_url=client.get_auth_url()code=raw_input("Go to '%s' and authorize this application. Paste the provided code here:"%auth_url[0])response=client.fetch_token(code=code)print(response['refresh_token'])

注意:上面的示例假设您运行的是python 2.x。 raw_inputinput

获取活动

使用Smashrun.get_activities获取活动列表(摘要):

activities=client.get_activities()# returns an iterator that handles paginating through the APIforactivityinactivities:printactivity['startDateTimeLocal']

获取特定活动

使用Smashrun.get_activity获取特定活动:

activity=client.get_activity(1234)printactivity['recordingKeys']

有关可以执行的操作的详细信息,请参见the codeSmashrun API

贡献

非常感谢您的贡献!随时提交请求或文件 我们的一个问题。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在安卓中使用动画旋转某些东西   排序如何对Java ArrayList进行排序   JAVAlang.OutOfMemoryError:使用Apache POI读取excel时的Java堆空间   java Tomcat 8.0.20内存不足错误   显式EntityManager之后@RequestScoped Bean中的java LazyInitializationException。发现   java对象到片段的通信   java DidRangeBeanConsinRegion并不总是在altBeacon库中工作   用java将xml配置文件应用到我的应用程序中的最佳方法是什么?   输入Java扫描器和字母   字符串Java解析输出的消息   使用pdfbox或其他java库从pdf文件中提取文本时,如何检查文本旋转?   java如何在与给定值相同的记录中找到值   运行时中的java更改工件版本   线程“awteventque0”java中的swing异常。lang.NumberFormatException:空   java为什么数组中的字符串不起作用?