Chisle
The coding-agent plugin that bills 52% of a bare model across 20 live tasks. Terse persona + tool-output compressor + context diet.
翻訳待ち
Slack Developer Kit for Python
翻訳待ち
開発ツールPython · ShellGitHub @slackapi自分でインストール所有者未確認
Paste into Claude or ChatGPT for installation instructions suited to your environment.
Have you tried it? One tap is enough. No sign-in needed.
Loading the full README. The saved excerpt is shown below.
The Slack platform offers several APIs to build apps. Each Slack API delivers part of the capabilities from the platform, so that you can pick just those that fit for your needs. This SDK offers a corresponding package for each of Slack’s APIs. They are small and powerful when used independently, and work seamlessly when used together, too.
Comprehensive documentation on using the Slack Python can be found at https://docs.slack.dev/tools/python-slack-sdk/Read the full README ↗The Slack platform offers several APIs to build apps. Each Slack API delivers part of the capabilities from the platform, so that you can pick just those that fit for your needs. This SDK offers a corresponding package for each of Slack’s APIs. They are small and powerful when used independently, and work seamlessly when used together, too.
Comprehensive documentation on using the Slack Python can be found at https://docs.slack.dev/tools/python-slack-sdk/
Whether you're building a custom app for your team, or integrating a third party service into your Slack workflows, Slack Developer Kit for Python allows you to leverage the flexibility of Python to get your project up and running as quickly as possible.
The Python Slack SDK allows interaction with:
slack_sdk.web: for calling the Web API methodsslack_sdk.webhook: for utilizing the Incoming Webhooks and response_urls in payloadsslack_sdk.signature: for verifying incoming requests from the Slack API serverslack_sdk.socket_mode: for receiving and sending messages over Socket Mode connectionsslack_sdk.audit_logs: for utilizing Audit Logs APIsslack_sdk.scim: for utilizing SCIM APIsslack_sdk.oauth: for implementing the Slack OAuth flowslack_sdk.models: for constructing Block Kit UI components using easy-to-use buildersslack_sdk.rtm: for utilizing the RTM APIIf you want to use our Events API and Interactivity features, please check the Bolt for Python library. Details on the Tokens and Authentication can be found in our Auth Guide.
Are you looking for slackclient? The slackclient project is in maintenance mode now and this slack_sdk is the successor. If you have time to make a migration to slack_sdk v3, please follow our migration guide to ensure your app continues working after updating.
This library requires Python 3.7 and above. If you're unsure how to check what version of Python you're on, you can check it using the following:
Note: You may need to use
python3before your commands to ensure you use the correct Python path. e.g.python3 --version
python --version
-- or --
python3 --version
We recommend using PyPI to install the Slack Developer Kit for Python.
$ pip install slack_sdk
We've created this tutorial to build a basic Slack app in less than 10 minutes. It requires some general programming knowledge, and Python basics. It focuses on the interacting with the Slack Web API and RTM API. Use it to give you an idea of how to use this SDK.
Read the tutorial to get started!
Slack provide a Web API that gives you the ability to build applications that interact with Slack in a variety of ways. This Development Kit is a module based wrapper that makes interaction with that API easier. We have a basic example here with some of the more common uses but a full list of the available methods are available here. More detailed examples can be found in our guide.
One of the most common use-cases is sending a message to Slack. If you want to send a message as your app, or as a user, this method can do both. In our examples, we specify the channel name, however it is recommended to use the channel_id where possible. Also, if your app's bot user is not in a channel yet, invite the bot user before running the code snippet (or add chat:write.public to Bot Token Scopes for posting in any public channels).
import os
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
client = WebClient(token=os.environ['SLACK_BOT_TOKEN'])
try:
response = client.chat_postMessage(channel='#random', text="Hello world!")
assert response["message"]["text"] == "Hello world!"
except SlackApiError as e:
# You will get a SlackApiError if "ok" is False
assert e.response["ok"] is False
assert e.response["error"] # str like 'invalid_auth', 'channel_not_found'
print(f"Got an error: {e.response['error']}")
# Also receive a corresponding status_code
assert isinstance(e.response.status_code, int)
print(f"Received a response status_code: {e.response.status_code}")
This is the beginning of the README. Read the rest at the original. Read the full README ↗