Connecting Python To Slack For Testing And Development
The scripting language Python can retrieve information from or publish information into the messaging app Slack. This means you can write a program that puts info into Slack for you, or accepts your queries using Slack as the interface. This is useful if you spend a lot of time in Slack, as I do.
The hard work of integrating Slack and Python has been done already. Slack offers an API, and there are at least two open source Python libraries that make leveraging these APIs in your Python code a simple task. I chose slacker after a bit of googling, but it’s not a preference borne of experience. The community seems to be behind slacker as opposed to Slack’s own python-slackclient, so I went that direction.
Steps
- I’ll assume you’ve got Python installed already. My environment is Ubuntu Server 16.04 with Python 2.7.12.
- Install the python package manger pip, if you don’t already have it.
sudo apt install python-pip - Install the slacker python library.
pip install slacker - Generate a testing and dev token at the Slack API web site.
https://api.slack.com/web

- The token will be everything required for authentication to your Slack group. Protect it Continue reading



Huawei Inaugurates largest Global Service Center in India.
The Pangyo facility will be developers' gateway to Watson.
Cloud company will become privately held when deal is complete.