松弛API客户端

slacker的Python项目详细描述


pypibuild statuspypi downloadslicensegitter chat

https://raw.githubusercontent.com/os/slacker/master/static/slacker.jpg

关于

slacker是Slack API的全功能python接口。

安装

$ pip install slacker

示例

fromslackerimportSlackerslack=Slacker('<your-slack-api-token-goes-here>')# Send a message to #general channelslack.chat.post_message('#general','Hello fellow slackers!')# Get users listresponse=slack.users.list()users=response.body['members']# Upload a fileslack.files.upload('hello.txt')# If you need to proxy the requestsproxy_endpoint='http://myproxy:3128'slack=Slacker('<your-slack-api-token-goes-here>',http_proxy=proxy_endpoint,https_proxy=proxy_endpoint)# Advanced: Use `request.Session` for connection pooling (reuse)fromrequests.sessionsimportSessionwithSession()assession:slack=Slacker(token,session=session)slack.chat.post_message('#general','All these requests')slack.chat.post_message('#general','go through')slack.chat.post_message('#general','a single https connection')

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

推荐PyPI第三方库


热门话题
JavaFX进度条从单独的函数更改而来   jvm使用java服务器选项   java在<li>元素中查找同名的最后一个链接   java问题将参数传递给不同公共类中的构造函数   如何在php中从java函数中获取字符串   java如何在Android中动态显示多个tile   java仅使用Ribbon而不使用任何服务注册表是否可以实现负载平衡?   Jersey 1.19版本的java Swagger JAXRS出现“冲突URI模板”错误   带H2数据库的java Spring boot jpa   从12:00:00到00:00:00的日期转换   Android中的java如何设置文本?   java密钥库“不支持的保护参数”   http使用Java在Java中发送httprequest。净包   SpringJava刷新数据库   java在Spring Boot应用程序中使用嵌入式MongoDb和MongoTemplate失败   java需要什么MatOfMatch对象?   xml使用Java中的合并算法将两个值合并为单个值   java SQLite数据库不保存数据为什么不工作