pythonpython-3.xslackslack-api

Is slack's python library "slack" different from "slack_sdk"


When it comes to Python, there are two slack libraries (among others) that provide an API for file upload (files_upload):

  1. slack
  2. slack_sdk

I wonder if these two are two separate libraries. Or, maybe they are two names for the same library? I ask this, particularly, because Slack has announced that slack_sdk.WebClient.files_upload will be deprecated on May 2025. I wonder if slack.WebClient.files_upload will be deprecated as well. And as a second question: Is there a recommendation of using slack_sdk over slack or vice versa?

So far I was not able to see a documentation for slack library. All searches direct me to slakck_sdk documentation (The one with soon-to-be-deprecated function files_upload).


Solution

  • The Python package slack is unrelated to the Slack chat service.

    The Python package slackclient is an old version of the official Slack python library. The modules in this package are in the slack namespace, meaning that you would have done pip install slackclient but import slack. This version is in "maintenance mode".

    The Python package slack_sdk is the new version of the official Slack python library, and its modules also use the slack_sdk namespace. There is a migration guide. They are temporarily also allowing to be imported as slack, but state that this currently provides deprecation warnings, and may eventually be removed.

    You should only install one of the last two packages, as they are different versions of the same code. It would be recommended to use the latest version, slack_sdk, and to move away from the deprecated function you mentioned.