Skip to main content

A collection of simple, pre-configured Slack block kit components to use with Slack notification messages.

Project description

CA Slack Block Kit

A collection of simple, pre-configured Slack block kit components to use to construct Slack notification messages.

Installation

This package is only available for installation via Git.

UV Project

uv add 'git+https://github.com/citizensadvice/ca-slack-block-kit'

Poetry Project

poetry add 'git+https://github.com/citizensadvice/ca-slack-block-kit'

Usage

To form a Slack message, import the required components from the package and use them to build your message payload as a list of Block instances.

from ca_slack_block_kit import Block, Divider, Header, MarkdownSection, render_blocks

message: list[Block] = []

message.append(Header("This is a header"))
message.append(Divider())
message.append(MarkdownSection("**This is a markdown section**"))

# The message can then be sent using the Slack SDK
client = slack_sdk.WebClient(token=slack_bot_token)
client.chat_postMessage(
    channel=<slack_channel_id>,
    text=<title_text>,
    blocks=render_blocks(message),
)

Available Blocks

See the full documentation for a list of available blocks and their usage.

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

ca_slack_block_kit-1.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

ca_slack_block_kit-1.1.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file ca_slack_block_kit-1.1.1.tar.gz.

File metadata

  • Download URL: ca_slack_block_kit-1.1.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ca_slack_block_kit-1.1.1.tar.gz
Algorithm Hash digest
SHA256 435da8a48cde9cfdcb090b480217dbddf14044b3145219af3d84f03c759b8229
MD5 7bf6930308193453bf2947830c6cb0f7
BLAKE2b-256 bb764d0b122e4fabd23a3e24c3a5c636c87f4eead03fd7b1edd9aadf6d91959e

See more details on using hashes here.

File details

Details for the file ca_slack_block_kit-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: ca_slack_block_kit-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ca_slack_block_kit-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 808006b9c4a6c0f2414837ff49386b13d5f05b4af726908be897e2335de8ed88
MD5 6b1459a0ac504aaf88abc7dd84b4f6f6
BLAKE2b-256 1ee28e168e2d187806262fe1a4a7539456b9d99e89be5db6b0a2cb9d28cd5a9a

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