{"library":"slackblocks","title":"Slack Blocks API Python Wrapper","description":"Python wrapper for the Slack Blocks API, providing a fluent interface for constructing Block Kit messages. Current version 1.2.3 works with Python >= 3.8.1, released occasionally with minor updates. It aims to simplify building complex Slack message layouts.","language":"python","status":"active","last_verified":"Mon Apr 27","install":{"commands":["pip install slackblocks"],"cli":null},"imports":["from slackblocks import Message","from slackblocks import SectionBlock","from slackblocks import ImageBlock","from slackblocks import DividerBlock","from slackblocks import ContextBlock"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom slackblocks import Message, SectionBlock, ImageBlock\n\nmessage = Message(\n    channel=\"#general\",\n    text=\"Hello, world!\",\n    blocks=[\n        SectionBlock(text=\"This is a section block\"),\n        ImageBlock(image_url=\"https://example.com/image.png\", alt_text=\"Example Image\")\n    ]\n)\n# Send via slack_sdk or similar\nfrom slack_sdk import WebClient\nclient = WebClient(token=os.environ.get(\"SLACK_TOKEN\", \"\"))\nresponse = client.chat_postMessage(**message)\nprint(response)","lang":"python","description":"Construct a basic Slack message with a section and an image block, then send using slack_sdk.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}