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什么是VMObject?   java将数据插入H2数据库表   java如何修改保存在一个卡夫卡主题中的Twitter API消息并将其发送到另一个卡夫卡主题   对象Java变量别名解决方法   java返回数组在try/catch中初始化   java DateTimeFormat shortDate无年份   java我如何在recycle应用程序的首次发布中突出显示项目   java使文本区域包含大量文本,其帧响应更快   类抛出的java ClassCircularyError。forName在转换TwoStacksPlainDatagramSocketImpl类时   swing如何在GroupLayout Java中设置Jframe背景图像   sip无法在独立java应用程序上运行PJSIPJNI包装   java Android internet连接问题   java当单击按钮VerEstoque时,应用程序停止。代码上有Logcat错误,请输入h3lp   java如何在JFrame上设置图像图标动画图像将加载但不会更改   与socket一起使用时,java错误的currentTimeMillis()   Java内部字符串表示:是UTF16吗?