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

Uploaded Source

Built Distribution

blockkit-0.7.1-py2.py3-none-any.whl (9.0 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: blockkit-0.7.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.7

File hashes

Hashes for blockkit-0.7.1.tar.gz
Algorithm Hash digest
SHA256 733c03e01df671798127d8efe9ed5023526a3b049ac76649a9a3058efe7ea5d3
MD5 c4e11314ed6f512109ec375e1411306b
BLAKE2b-256 f441df66e4999a0cf2062243e4d71aba65ba8a0acf858be10e1c3072f19123bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blockkit-0.7.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.7

File hashes

Hashes for blockkit-0.7.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a97531d6c13b595165ac95791ea2120e236baec1c4a8dd6325f3ded7342e1614
MD5 b711f645c55bb5798147690d37ae4b07
BLAKE2b-256 94dcc42976a094476412746cfcb21b7a634a3d6a9d7c68243e3c1b62d8224de1

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