Skip to main content

A fast way to build Block Kit interfaces in Python.

Project description

blockkit-python

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="click_me_123"),
                Button(PlainText("Decline"), style=Button.danger, action_id="click_me_456"),
                Button(PlainText("Discuss"), action_id="click_me_456"),
            ]
        ),
    ]
)

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blockkit-0.1.0-py2.py3-none-any.whl (8.1 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: blockkit-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.5

File hashes

Hashes for blockkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4a9d0cb514d293d9f18564f564a2433b4a815d46ac037952405f203151947fb0
MD5 1c4c23c10cf65f153542b83780cb3e71
BLAKE2b-256 19d5b0b605167bb9f5de02cbfff463d1a5cbcc0455fd72c9de1443321d546a63

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blockkit-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.5

File hashes

Hashes for blockkit-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4e06f05e8e31161f594fd6a6a4bb5b9808a35b082ddc872e7a0f119824a6fcb0
MD5 00dcbad5ded38675b0d9a7a586615d8c
BLAKE2b-256 8d6c48e385eed2df56c3e713c1f99df7375243dde5fd26cef5e915650e754f3d

See more details on using hashes here.

Supported by

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