Slack SDK for Python

The official Python SDK for building apps, bots, and integrations on the Slack Platform.

SDK
PyPI
v3.45.0
4,017 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
97 /100 Excellent
Development Activity 100
Maintenance 96
Community 92
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
80 /100 Excellent
Architecture 85
Code Quality 84
Innovation 78
Learning Curve 72

slack-sdk is the official Python SDK maintained by Slack for building apps on the Slack Platform. Rather than a single monolithic client, it bundles a set of focused modules for each of Slack’s APIs: a synchronous and asyncio-based Web API client, a legacy RTM client, Socket Mode support, OAuth flow helpers with pluggable installation/token stores, SCIM and Audit Logs clients, and standalone webhook and signature-verification utilities. Each module can be used independently or combined depending on what a given integration needs.

The SDK is widely used across the Slack developer ecosystem for building bots, workflow apps, and internal tooling that posts messages, manages users, or reacts to events. Its OAuth and installation-store abstractions make it a common building block for multi-workspace Slack apps distributed via the Slack App Directory, while the lower-level webhook and signature modules see use in lightweight serverless integrations that only need to verify and respond to Slack events.

What You Get

  • A synchronous and an asyncio WebClient/AsyncWebClient covering the full Slack Web API surface
  • Socket Mode and legacy RTM clients for realtime event handling without exposing a public HTTP endpoint
  • OAuth flow helpers (slack_sdk.oauth) with pluggable installation and token stores for multi-workspace apps
  • SCIM and Audit Logs API clients for enterprise-grid provisioning and compliance use cases
  • Standalone webhook and signature modules for verifying and responding to incoming Slack requests
  • Built-in HTTP retry handlers and typed request/response models across the API surface

Common Use Cases

  • Building Slack bots and workflow apps that post messages, react to events, and manage channels
  • Handling OAuth installation flows for Slack apps distributed to multiple workspaces
  • Verifying and responding to Slack Events API / interactivity webhooks in serverless functions
  • Automating Slack workspace administration via SCIM (user provisioning) or Audit Logs APIs
  • Building realtime integrations with Socket Mode when a public HTTPS endpoint isn’t available

Under The Hood

Architecture - The SDK is organized as a set of independent client modules under slack_sdk/ (web/, rtm/, rtm_v2/, socket_mode/, oauth/, scim/, audit_logs/, webhook/, signature/), each usable on its own without pulling in the others. The Web API layer splits base_client.py/client.py (sync) from async_base_client.py/async_client.py (asyncio), sharing request-building logic through a common base class, while slack_response.py/async_slack_response.py wrap raw HTTP responses in a dict-like, paginated response object. OAuth support (oauth/installation_store/) is built around a pluggable store interface so apps can swap in-memory, file, SQLAlchemy, or custom persistence for installation/token data without touching the OAuth flow logic itself.

Tech Stack - Pure Python (per GitHub’s language stats) supporting Python 3.7+, with aiohttp as the optional dependency for the async client and Socket Mode’s websocket transport (topics include aiohttp, aiohttp-client, asyncio, websocket-client). Packaging uses a pyproject.toml with dynamic version/readme/optional-dependencies resolved via setup.cfg, and CI runs through GitHub Actions with Codecov coverage reporting, reflecting Slack’s own maintenance of the package (top contributor seratch is a Slack engineer).

Code Quality - The tests/ tree mirrors the source layout almost 1:1 (tests/slack_sdk/web, tests/slack_sdk/oauth, tests/slack_sdk_async/..., tests/webhook, tests/signature), with 118 test files and a dedicated mock_web_api_server fixture directory for testing HTTP client behavior without hitting real Slack endpoints. Both sync and async code paths get parallel test coverage (tests/slack_sdk vs tests/slack_sdk_async), and the project ships an AGENTS.md plus SECURITY.md, indicating active maintenance practices beyond just code.

API Design - The SDK favors one client class per concern (WebClient, SocketModeClient, WebhookClient, SignatureVerifier) over a single do-everything object, so integrators only import what they need. Method names on WebClient map directly to Slack Web API method names (e.g. chat_postMessage), which keeps the SDK easy to cross-reference against Slack’s own API docs at the cost of not fully conforming to Python naming conventions — a deliberate trade-off favoring API discoverability.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers