blockkit
A fast way to build Block Kit interfaces in Python
What it is and what it does
BlockKit is a Python wrapper around Slack's Block Kit UI framework that replaces hand-written JSON with a fluent, chainable API. Instead of nesting dictionaries and guessing field names, you call methods like `.add_block()`, `.section()`, and `.button()` with type hints and built-in validation. The library enforces Slack's rules—required fields, valid enum values, text length limits—at build time, catching errors before they reach Slack's API.
It ships as a single wheel with no external dependencies, making installation and deployment straightforward. The API is designed for readability: you write code that looks like the UI structure you're building, and your editor autocompletes the available methods. Maintenance is aging (last commit 208 days ago), so while the library is stable for current Slack features, updates to Slack's API may lag.
Use it for:
- Build approval workflows and interactive modals for Slack apps without memorizing Block Kit JSON structure.
- Validate Slack message payloads before sending, catching typos and missing required fields locally.
- Refactor complex Slack UI code by using readable, chainable method calls instead of nested dictionaries.
- Generate dynamic Slack messages and forms in Python bots with type safety and IDE autocomplete.
- Reduce debugging time by letting BlockKit catch field-name and enum-value errors at build time.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
BlockKit builds Slack UI blocks programmatically with a fluent Python API, type hints, and validation—no hand-written JSON, zero runtime dependencies.
Yes, if you are building Slack apps in Python. BlockKit eliminates boilerplate and catches errors early. Install friction is negligible (zero dependencies, pure Python), licensing is permissive, and no known vulnerabilities exist. The main caveat is aging maintenance—if Slack releases major Block Kit changes, updates may be slow. For active Slack development, this is a solid productivity win; for long-term projects requiring rapid Slack API tracking, monitor the repository.
Install
blockkit on PyPI
pip
pip install blockkituv
uv add blockkitpoetry
poetry add blockkitInstalling blockkit
Before you install
Low friction: pure Python wheel with zero runtime dependencies and a recent commit history. Maintenance status is aging—last commit 2026-01-18, no activity in 208 days—so expect slower response to issues or API changes from Slack.
License in practice
MIT license (permissive) means you can use, modify, and distribute BlockKit freely in commercial or private projects with minimal legal friction.
Quickstart
pip install blockkit
from blockkit import Message, Section, Button
message = (
Message()
.add_block(Section("Approve this request"))
.add_block(Button("Approve").action_id("btn"))
.build()
)
Requires Python 3.11 or later.
Verify before relying
- Whether the library covers all current Slack Block Kit features or only a subset.
- How often Slack's Block Kit API changes and whether BlockKit stays in sync.
- Community adoption and real-world stability beyond the 104 GitHub stars.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 208 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 102,261/month — #12,877 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: blockkit-2.1.3-py3-none-any.whl
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
pyblock-builderPyBlock Builder provides Python classes and…
permissive · top 15,000 on PyPI
slackblocksBuilds Slack Block Kit messages…
permissive · top 15,000 on PyPI
slackify-markdownConverts standard Markdown to Slack-compatible…
permissive · top 15,000 on PyPI
slackclientProvides Python interfaces to Slack's Web API…
permissive · top 5,000 on PyPI
slack-boltBolt for Python is a framework for building…
permissive · top 5,000 on PyPI
markdown-to-mrkdwnConverts standard Markdown to Slack's mrkdwn…
permissive · top 5,000 on PyPI
prefect-slackProvides prebuilt Prefect tasks and blocks to…
permissive · top 15,000 on PyPI
mdformat-blackA plugin for mdformat that automatically…
permissive · top 15,000 on PyPI
md2SlackConverts Markdown syntax into Slack-compatible…
permissive · top 15,000 on PyPI
prefab-uiPrefab is a Python UI framework for building…
permissive · top 15,000 on PyPI