Build Slack apps and bots with Python and asyncio
B

Build Slack apps and bots with Python and asyncio

Build Slack apps and bots with Python and asyncio

UI
4,008 stars
N/A forks
N/A contributors

README

Project documentation from GitHub

Build Slack Apps and Bots with Python and asyncio

If you've ever wanted to build a Slack app or bot in Python, you know the initial setup can be a bit of a chore. Between handling events, managing authentication, and dealing with async operations, it's easy to get bogged down before you even write your first feature. What if there was a solid, well-maintained SDK that handled the heavy lifting for you?

Enter the Slack Python SDK. This official library from Slack provides a clean, asyncio-friendly way to interact with the Slack platform. Whether you're building a simple slash command, a bot that responds to messages, or a full-fledged app with OAuth, this toolkit is designed to get you up and running without the boilerplate headache.

What It Does

The python-slack-sdk is the official Python library for Slack's Web API and real-time messaging (via Socket Mode). It gives you a comprehensive set of tools to build Slack integrations. You can use it to post messages, listen for events (like reactions or new channel messages), build interactive modals, and manage your app's configuration—all from your Python codebase.

At its core, it abstracts the HTTP calls and WebSocket management, letting you focus on your app's logic instead of the protocol details.

Why It's Cool

The real win here is how it embraces modern Python. The SDK is built with asyncio in mind, offering both async and sync client options. This means you can build highly responsive bots that handle multiple events concurrently without blocking. If you're using a framework like FastAPI or any async-first application, it fits right in.

It also handles the tricky parts for you. Want to set up event subscriptions? The SDK includes an adapter for popular web frameworks (like Flask and Starlette) to verify and parse incoming requests. Need to use Socket Mode for apps behind firewalls? It manages the WebSocket lifecycle automatically. It even includes built-in retry logic for rate limits and transient failures.

The library is modular, too. You can install just the Web API client if that's all you need, or add the socket mode and OAuth components as your app grows. This keeps your dependencies lean.

How to Try It

Getting started is straightforward. First, install the package. If you want the full suite (including Socket Mode and server framework adapters), you can install it with pip:

pip install slack_sdk

For a more minimal install, you can pick specific components:

pip install slack_sdk # Web API client only
# or
pip install slack_sdk[socketmode] # Add Socket Mode support

Next, you'll need a Slack app. Head over to api.slack.com/apps to create one and grab your bot token (it'll start with xoxb-). Then,

Did you like this issue?

Join our weekly newsletter

Related Projects

Love discovering amazing projects?

Help us continue bringing you the best open-source discoveries every week.

Back to Projects
Last updated: Jan 8, 2026