

Why? If you publish your source code in a public repository, anyone that trawls through it potentially has access to your Slack channel from their own app. Some other library sample code shows putting the Slack access token right in the source code as a static variable assignment, which is a terrible, horrible, no good, very bad idea. The slackclient library is security-conscious.

Maybe you’d prefer an alternate library like slacker. But it’s not a preference borne of experience. In addition, most code examples I turned up are using python-slackclient. Github reveals that python-slackclient is an active project, with recent commits. When searching for Slack projects using Python, most of the top hits are using Slack’s official python-slackclient. Slack offers an API, and there are at least two open source Python libraries that make leveraging these APIs in your Python code easy. The hard work of integrating Slack and Python has been done already. This is useful if you spend a lot of time in Slack, as I do. This means you can write a chatbot that puts info into Slack for you, or accepts your queries using Slack as the interface. The scripting language Python can retrieve information from or publish information to the messaging app Slack. Plugging Python Code Into Slack, Maybe For A Chatbot
