松弛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第三方库


热门话题
java如何将JButton合并到图形中?   java在每个循环中使用基类类型或派生类类型   JavaSwingGUI应用程序完全是空白的,没有任何内容,而按钮被添加到面板中   java Android获取getDefaultSensor括号时出错   java Spring引导和安全性与AngularJS登录页面   java注销appengine应用程序而不从google注销。通用域名格式   java仅在发生错误或异常时创建日志文件,而不使用log4j   java get json数组和Retrift 2   swing中的java响应映像   为什么java的inputstream。close()块?   java驱动管理器。getConnection()非常冗长   java如何使用joml将标准化向量旋转到一个点   ubuntu将Java程序的输出结果保存到一个文件中   java动态可拖动、可编辑和自动调整大小的文本字段