Skip to content

Installation

You can install slackblocks using any Python package manager with access to PyPI. Installation commands for some of the more popular ones are included below.

pip install slackblocks
poetry add slackblocks
pipenv install slackblocks
uv add slackblocks

slackblocks is a pure Python package and is published to PyPI as a wheel on every release. As of v0.1.0 it has no dependencies outside of the Python standard library.

Requirements

  • Python 3.8.1 or newer for the 1.x release line.
  • Python 3.10 or newer for the 2.x release line (in development).
  • No runtime dependencies.

For the full Python version support matrix and how to pin to a release line that matches your runtime, see Compatibility.

Verifying your installation

from slackblocks import Message, SectionBlock

print(Message(channel="#general", blocks=SectionBlock("Hello, world!")).json())

If this prints a formatted JSON object describing a message, you're ready to go.

Version pinning

slackblocks follows semantic versioning. Pinning to a major version is recommended:

slackblocks~=1.2
slackblocks = "^1.2"

Uninstalling

pip uninstall slackblocks
poetry remove slackblocks
pipenv uninstall slackblocks
uv remove slackblocks