A fast way to build Block Kit interfaces in Python.
Project description
blockkit-slack
A fast way to build Block Kit interfaces in Python
Installation
Use the package manager pip to install blockkit.
pip install blockkit
Usage
from blockkit import Message, Section, Actions, MarkdownText, Button
message = Message(
blocks=[
Section(MarkdownText("You have a new request")),
Section(
MarkdownText("Which is"),
fields=[
MarkdownText("*Type:*\nComputer (laptop)"),
MarkdownText("*When:*\nSubmitted Aut 10"),
MarkdownText("*Last Update:*\nMar 10, 2015 (3 years, 5 months)"),
MarkdownText("*Reason:*\nAll vowel keys aren't working."),
MarkdownText("*Specs:*\nCheetah Pro 15 - Fast, really fast"),
],
),
Actions(
[
Button("Approve", style=Button.primary, action_id="approve"),
Button("Decline", style=Button.danger, action_id="decline"),
Button("Discuss", action_id="discuss"),
]
),
]
)
message = message.build()
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
blockkit-0.4.0.tar.gz
(7.0 kB
view details)
Built Distribution
File details
Details for the file blockkit-0.4.0.tar.gz
.
File metadata
- Download URL: blockkit-0.4.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 019e201776e230cc6b831c10ff31662b290f30e0b0346811f23443e307138913 |
|
MD5 | d09579a4d001435f41bd662e75115cdc |
|
BLAKE2b-256 | b8b05b54748c509bb5bd15dead8ff277914e709327bd05b623bb5c0b51233946 |
File details
Details for the file blockkit-0.4.0-py2.py3-none-any.whl
.
File metadata
- Download URL: blockkit-0.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4aede3e929829b6963ac79144d5de3ea21c369768e9899e12e1960c4273815bd |
|
MD5 | d03389590e2756dc29b8576ed5b9d27a |
|
BLAKE2b-256 | 8ffea1fedff205de0d37534a88b98bbefc4429dec7767ad72dfe8261e6b5b02f |