A fast way to build Block Kit interfaces in Python
Low maintenance activity. Last release 10 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and issue handling.
Consider insteadslackblocksPythie’s Index: 852.2M downloads/moCompare →
pip install blockkit
Documentation: https://blockkit.botsignals.co
Source Code: https://github.com/imryche/blockkit
BlockKit for Python
Build beautiful Slack UIs fast. Fluent API with type hints, validation, and zero dependencies.
pip install blockkit
Here's the thing
Building Slack apps shouldn't feel like writing JSON by hand. It's tedious. It's error prone. And honestly? It's a waste of your time.
You know what you want to build. Your editor should help you build it. That's what BlockKit for Python does.
Before
This is what you're probably doing now:
# Building a simple approval message. What could go wrong?
message = {
"blocks": [{
"type": "section",
"text": {
"type": "mrkdwn", # 🤔 or was it "markdown"?
"text": "Please approve *Alice's* expense report for $42"
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text", # 😕 wait, why can't buttons use mrkdwn?
"text": "Approve" # 🤞 hope this isn't too long
},
"action_id": "approve_button",
"style": "green", # ❌ is it "green"? "success"? "primary"?
"confirm": { # 🤔 what's the structure again?
"title": {
"type": "plain_text",
"text": "Are you sure?"
},
"text": {
"type": "plain_text",
"text": "This action cannot be undone"
},
"confirm": {
"type": "plain_text",
"text": "Yes, approve"
}
# ❌ forgot the required "deny" field
}
}
}],
"thread_ts": 1234567890 # ❌ wait, should this be a string?
}
# Three bugs. Deeply nested JSON. Good luck debugging this.