Skip to main content

A fast way to build Block Kit interfaces in Python.

Project description

blockkit-slack

Build Status

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, PlainText


message = Message(
    blocks=[
        Section(
            MarkdownText("You have a new request:\n*<fakeLink.toEmployeeProfile.com|Fred Enriquez - New device request>*")
        ),
        Section(
            MarkdownText("Laptop"),
            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(PlainText("Approve"), style=Button.primary, action_id="approve"),
                Button(PlainText("Decline"), style=Button.danger, action_id="decline"),
                Button(PlainText("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

MIT

Project details


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.3.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

blockkit-0.3.0-py2.py3-none-any.whl (8.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file blockkit-0.3.0.tar.gz.

File metadata

  • Download URL: blockkit-0.3.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

Hashes for blockkit-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8463cd24d9e8e9b8a04b484bc61f75ede84b401d55430001d1f8b35cb2bfe580
MD5 35ae04631be7f421b7ffb032b71c6fb6
BLAKE2b-256 fbcb6a8683899634998069e3de007037e17a90d1f169b56862ce86b406f6bace

See more details on using hashes here.

File details

Details for the file blockkit-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: blockkit-0.3.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

Hashes for blockkit-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 272f28074d8ea3ff1f3c665fe13f20e6c967286d53783b616f466d87bbe842dc
MD5 b9b2deef777a6892133e37767ac790a3
BLAKE2b-256 a38538ae876aa44ef020d4609275f11ad457204d2405fb9595ca0475078a8b96

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page