{ "info": { "author": "Nicholas Lambourne", "author_email": "nick@ndl.im", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Topic :: Communications :: Chat", "Typing :: Typed" ], "description": "# slackblocks \n\n![Build Status](https://api.travis-ci.org/nicklambourne/slackblocks.svg?branch=master)\n\n## What is it?\n\n`slackblocks` is Python API for building messages in the fancy new Slack Block Kit API.\n\nIt was created by [Nicholas Lambourne](https://github.com/nicklambourne) for the [UQCS Slack Bot](https://github.com/UQComputingSociety/uqcsbot) because he hates writing JSON.\n\nAs it turns out, the functionality that he was actually after exists in the outdated Slack Secondary Attachments API, but he was already in too deep to turn back.\n\nN.B: This is still WIP software and I some of the more tricky interactive Block elements have yet to be implemented.\n\n## Requirements\n`slackblocks` requires Python >= 3.6.\n\nAs of version 0.1.0 it has no dependencies outside the Python standard library.\n\n## Installation\n\n```bash\npip install slackblocks\n```\n\n## Usage\n\n```python\nfrom slackblocks import Message, SectionBlock\n\n\nblock = SectionBlock(\"Hello, world!\")\nmessage = Message(channel=\"#general\", blocks=block)\nmessage.json()\n\n```\n\nWill produce the following JSON string:\n```json\n{\n \"channel\": \"#general\",\n \"mrkdwn\": true,\n \"blocks\": [\n {\n \"type\": \"section\",\n \"block_id\": \"992ceb6b-9ad4-496b-b8e6-1bd8a632e8b3\",\n \"text\": {\n \"type\": \"mrkdwn\",\n \"text\": \"Hello, world!\",\n \"verbatim\": false\n }\n }\n ]\n}\n```\nWhich can be sent as payload to the Slack message API HTTP endpoints.\n\nOf more practical use is the ability to unpack the objects directly into \nthe Python Slack Client to send messages:\n```python\nfrom os import environ\nfrom slack import WebClient\nfrom slackblocks import Message, SectionBlock\n\n\nclient = WebClient(token=environ[\"SLACK_API_TOKEN\"])\nblock = SectionBlock(\"Hello, world!\")\nmessage = Message(channel=\"#general\", blocks=block)\n\nresponse = client.chat_postMessage(**message)\n```\n\nNote the `**` operator in front of the `message` object.\n\n## Can I use this in my project?\n\nYes, please do! The code is all open source and BSD-3.0 licensed.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nicklambourne/slackblocks", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "slackblocks", "package_url": "https://pypi.org/project/slackblocks/", "platform": "", "project_url": "https://pypi.org/project/slackblocks/", "project_urls": { "Homepage": "https://github.com/nicklambourne/slackblocks" }, "release_url": "https://pypi.org/project/slackblocks/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "Python wrapper for the Slack Blocks API", "version": "0.1.3" }, "last_serial": 5740401, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "cce562d2442abadc4f19eb10e56e0c21", "sha256": "799e9491752801f9c95d8c50b49900d2aa336ae2f0ce0b1ef9c95099765c48b4" }, "downloads": -1, "filename": "slackblocks-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "cce562d2442abadc4f19eb10e56e0c21", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8035, "upload_time": "2019-08-02T13:03:42", "url": "https://files.pythonhosted.org/packages/79/a1/a62eaf1d6b089791fa869581c632fe552802f1b562e16e561e8a837355f5/slackblocks-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c9c5b0f557eefb78bdda00644eb52471", "sha256": "8c70b3ea91e80bfe191791b30e56c456a7cf9b53b70eb0c0ee061f21daeafb0f" }, "downloads": -1, "filename": "slackblocks-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c9c5b0f557eefb78bdda00644eb52471", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5049, "upload_time": "2019-08-02T13:03:44", "url": "https://files.pythonhosted.org/packages/fb/ee/3c6bfd711106ed51e97ddb574a284520f2edc6ba7b1cd884f5e15ac60e71/slackblocks-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8119f4e063da3789d1f493eeaaaf9a54", "sha256": "7fc10f8d0532a4938ba004e06c1ad9a6f4d8a0d2329e1879ad28e3a759c52e35" }, "downloads": -1, "filename": "slackblocks-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8119f4e063da3789d1f493eeaaaf9a54", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9016, "upload_time": "2019-08-03T04:48:05", "url": "https://files.pythonhosted.org/packages/77/33/27bd1f48dc5fee6c6b20e2472eacb5622eaded20fb8c20096d3ae747de92/slackblocks-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2d5e5d76b1088a7036662ec2f8e7aa9d", "sha256": "ce1a3d00993e2fee5684f3e10dec5d973c72be9f88d6808a0ff127fd0efd9e26" }, "downloads": -1, "filename": "slackblocks-0.1.1.tar.gz", "has_sig": false, "md5_digest": "2d5e5d76b1088a7036662ec2f8e7aa9d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6164, "upload_time": "2019-08-03T04:48:06", "url": "https://files.pythonhosted.org/packages/33/ec/f72041e86bd2677657cedc2358202be21829cfef4c4e560c61051fd44992/slackblocks-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "9c71e4eb47304409bb9887c0ab3fb5cd", "sha256": "5e3065710a6b7e1f3232dddde9343fb6f52a584dd40b8f06702d9a4498066638" }, "downloads": -1, "filename": "slackblocks-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9c71e4eb47304409bb9887c0ab3fb5cd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9104, "upload_time": "2019-08-03T07:44:08", "url": "https://files.pythonhosted.org/packages/59/71/df32ba6776d13ca3011d9c396ecb795221a2b3b414fa878190b6c17abd11/slackblocks-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "acd03777aa29e858e6e5f5ef3465ff86", "sha256": "72e3757b56996f1ae5cff2b038c97b4b79ce0d3266fd3a2327f541d106f1e814" }, "downloads": -1, "filename": "slackblocks-0.1.2.tar.gz", "has_sig": false, "md5_digest": "acd03777aa29e858e6e5f5ef3465ff86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6218, "upload_time": "2019-08-03T07:44:09", "url": "https://files.pythonhosted.org/packages/a8/48/afe766d106f9818374093ef357e309d0f888bd2f823beb1561f49614c62d/slackblocks-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "998f25dd94b7e712e73eb14f1a5a5f12", "sha256": "0fb60c46a5e0cabd8cdc1e92f180f2f65adba827b027b2469a495bd1c15e420e" }, "downloads": -1, "filename": "slackblocks-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "998f25dd94b7e712e73eb14f1a5a5f12", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9151, "upload_time": "2019-08-28T02:53:41", "url": "https://files.pythonhosted.org/packages/e1/0f/297cbd7ae93caac6c3098c54bbd439f547c9cb64bd1a954b08b825444f23/slackblocks-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8eef603d9708303fc72055390d615a10", "sha256": "f68daafaafea5d297d191f2e4cbd12cf399c1fd2a88fb3b35f4a6160c4e56ddd" }, "downloads": -1, "filename": "slackblocks-0.1.3.tar.gz", "has_sig": false, "md5_digest": "8eef603d9708303fc72055390d615a10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6203, "upload_time": "2019-08-28T02:53:43", "url": "https://files.pythonhosted.org/packages/22/b8/f0ea8d7bd1320285d86e2c8fb20fba5c32167f41c20755078c9dbcd1484d/slackblocks-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "998f25dd94b7e712e73eb14f1a5a5f12", "sha256": "0fb60c46a5e0cabd8cdc1e92f180f2f65adba827b027b2469a495bd1c15e420e" }, "downloads": -1, "filename": "slackblocks-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "998f25dd94b7e712e73eb14f1a5a5f12", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9151, "upload_time": "2019-08-28T02:53:41", "url": "https://files.pythonhosted.org/packages/e1/0f/297cbd7ae93caac6c3098c54bbd439f547c9cb64bd1a954b08b825444f23/slackblocks-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8eef603d9708303fc72055390d615a10", "sha256": "f68daafaafea5d297d191f2e4cbd12cf399c1fd2a88fb3b35f4a6160c4e56ddd" }, "downloads": -1, "filename": "slackblocks-0.1.3.tar.gz", "has_sig": false, "md5_digest": "8eef603d9708303fc72055390d615a10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6203, "upload_time": "2019-08-28T02:53:43", "url": "https://files.pythonhosted.org/packages/22/b8/f0ea8d7bd1320285d86e2c8fb20fba5c32167f41c20755078c9dbcd1484d/slackblocks-0.1.3.tar.gz" } ] }