skillfed

blockkit

A fast way to build Block Kit interfaces in Python

blockkit v2.1.3 102.3K downloads/30d#12,877 on PyPI104
Permissive license AGING released

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 blockkit

uv

uv add blockkit

poetry

poetry add blockkit

Installing 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

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

slack ui builder pythonblock kit slack messagesslack block api wrapperslack modal form builderslack interactive componentsslack message blocks fluent apislack ui validationslack app interface builder
slack-integrationui-buildertype-safe

More Dynamic Content packages