Slacker is a full-featured Python interface for the Slack API.
from slacker import Slacker
slack = Slacker('<your-slack-api-token-goes-here>')
# Send a message to #general channel
slack.chat.post_message('#general', 'Hello fellow slackers!')
# Get users list
response = slack.users.list()
users = response.body['members']
# Upload a file
slack.files.upload('hello.txt')
# If you need to proxy the requests
proxyEndpoint = 'http://myproxy:3128'
slack = Slacker('<your-slack-api-token-goes-here>', httpProxy=proxyEndpoint, httpsProxy=proxyEndpoint)
# Send a message to #general channel
slack.chat.post_message('#general', 'Hello fellow slackers!', as_user=True)
$ pip install slacker