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


message = Message(
    blocks=[
        Section(MarkdownText("You have a new request")),
        Section(
            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

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

Uploaded Source

Built Distribution

blockkit-0.7.0-py2.py3-none-any.whl (9.3 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: blockkit-0.7.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for blockkit-0.7.0.tar.gz
Algorithm Hash digest
SHA256 7f4cbd524f814981450f70ff0baea4d1c40f5860e9ae2df81827e6398caa6b2a
MD5 9072660170f062dcd663c832706bdf90
BLAKE2b-256 7dfdbcf42fcd1aa191a83389f1b0eb0d9b7db1a28c77791d3663444639d52e5a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blockkit-0.7.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.3 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/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for blockkit-0.7.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3072886bc124f55467235471083da25fd5eb6b8cf5df5e8a1c38e70f03630ef9
MD5 33e5790831a2be53ad3258574ff611fe
BLAKE2b-256 040cea889b1aae48922917e2a7049a08caaa8ad7d948feae909473a980399e4e

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