slackblocks 1.2.2__tar.gz → 1.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {slackblocks-1.2.2 → slackblocks-1.2.4}/PKG-INFO +1 -2
- {slackblocks-1.2.2 → slackblocks-1.2.4}/pyproject.toml +1 -2
- {slackblocks-1.2.2 → slackblocks-1.2.4}/setup.py +1 -1
- {slackblocks-1.2.2 → slackblocks-1.2.4}/slackblocks/blocks.py +7 -2
- {slackblocks-1.2.2 → slackblocks-1.2.4}/slackblocks/rich_text/elements.py +2 -2
- {slackblocks-1.2.2 → slackblocks-1.2.4}/LICENSE +0 -0
- {slackblocks-1.2.2 → slackblocks-1.2.4}/LICENSE.BSD-3-Clause +0 -0
- {slackblocks-1.2.2 → slackblocks-1.2.4}/README.md +0 -0
- {slackblocks-1.2.2 → slackblocks-1.2.4}/slackblocks/__init__.py +0 -0
- {slackblocks-1.2.2 → slackblocks-1.2.4}/slackblocks/attachments.py +0 -0
- {slackblocks-1.2.2 → slackblocks-1.2.4}/slackblocks/elements.py +0 -0
- {slackblocks-1.2.2 → slackblocks-1.2.4}/slackblocks/errors.py +0 -0
- {slackblocks-1.2.2 → slackblocks-1.2.4}/slackblocks/messages.py +0 -0
- {slackblocks-1.2.2 → slackblocks-1.2.4}/slackblocks/modals.py +0 -0
- {slackblocks-1.2.2 → slackblocks-1.2.4}/slackblocks/objects.py +0 -0
- {slackblocks-1.2.2 → slackblocks-1.2.4}/slackblocks/rich_text/__init__.py +0 -0
- {slackblocks-1.2.2 → slackblocks-1.2.4}/slackblocks/rich_text/objects.py +0 -0
- {slackblocks-1.2.2 → slackblocks-1.2.4}/slackblocks/utils.py +0 -0
- {slackblocks-1.2.2 → slackblocks-1.2.4}/slackblocks/views.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: slackblocks
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: Python wrapper for the Slack Blocks API
|
|
5
5
|
Home-page: https://github.com/nicklambourne/slackblocks
|
|
6
6
|
License: MIT
|
|
@@ -22,7 +22,6 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.12
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.13
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.14
|
|
25
|
-
Classifier: Programming Language :: Python :: 3.15
|
|
26
25
|
Classifier: Programming Language :: Python :: 3.8
|
|
27
26
|
Classifier: Programming Language :: Python :: 3.9
|
|
28
27
|
Classifier: Topic :: Communications :: Chat
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "slackblocks"
|
|
3
|
-
version = "1.2.
|
|
3
|
+
version = "1.2.4"
|
|
4
4
|
description = "Python wrapper for the Slack Blocks API"
|
|
5
5
|
authors = [
|
|
6
6
|
"Nicholas Lambourne <dev@ndl.im>",
|
|
@@ -28,7 +28,6 @@ classifiers=[
|
|
|
28
28
|
"Programming Language :: Python :: 3.12",
|
|
29
29
|
"Programming Language :: Python :: 3.13",
|
|
30
30
|
"Programming Language :: Python :: 3.14",
|
|
31
|
-
"Programming Language :: Python :: 3.15",
|
|
32
31
|
"License :: OSI Approved :: BSD License",
|
|
33
32
|
"License :: OSI Approved :: MIT License",
|
|
34
33
|
"Operating System :: OS Independent",
|
|
@@ -9,7 +9,7 @@ package_data = \
|
|
|
9
9
|
|
|
10
10
|
setup_kwargs = {
|
|
11
11
|
'name': 'slackblocks',
|
|
12
|
-
'version': '1.2.
|
|
12
|
+
'version': '1.2.4',
|
|
13
13
|
'description': 'Python wrapper for the Slack Blocks API',
|
|
14
14
|
'long_description': '# slackblocks <img src="https://github.com/nicklambourne/slackblocks/raw/master/docs_src/img/sb.png" align="right" width="250px"/>\n\n\n\n\n[](https://pypi.org/project/slackblocks/#history)\n[](https://pepy.tech/project/slackblocks)\n[](https://github.com/nicklambourne/slackblocks/actions)\n[](https://nicklambourne.github.io/slackblocks)\n\n## What is it?\n`slackblocks` is a Python API for building messages in the fancy Slack [Block Kit API](https://api.slack.com/block-kit)\n\n## Documentation\nFull documentation is provided [here](https://nicklambourne.github.io/slackblocks/latest/).\n\n## Requirements\n`slackblocks` requires Python >= 3.8.\n\nAs of version 0.1.0 it has no dependencies outside the Python standard library.\n\n## Installation\n```bash\npip install slackblocks\n```\n\n## Basic Usage\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 }\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 [(Legacy) Python Slack Client](https://pypi.org/project/slackclient/) in order to send messages:\n\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\nOr the modern Python [Slack SDK](https://pypi.org/project/slack-sdk/):\n```python\nfrom os import environ\nfrom slack_sdk 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?\nYes, please do! The code is all open source and dual BSD-3.0 and MIT licensed\n (use what suits you best).\n',
|
|
15
15
|
'author': 'Nicholas Lambourne',
|
|
@@ -493,12 +493,17 @@ class TableBlock(Block):
|
|
|
493
493
|
A `TableBlock` displays data in a table format.
|
|
494
494
|
|
|
495
495
|
Args:
|
|
496
|
-
rows: a list of lists of `
|
|
496
|
+
rows: a list of lists of `RawText` or `RichTextObject` objects.
|
|
497
497
|
column_settings: a list of `ColumnSettings` objects.
|
|
498
498
|
block_id: you can use this field to provide a deterministic identifier for the block.
|
|
499
499
|
|
|
500
500
|
Throws:
|
|
501
|
-
InvalidUsageError: when items in `rows` are not `
|
|
501
|
+
InvalidUsageError: when items in `rows` are not `RawText` or `RichTextObject` objects.
|
|
502
|
+
InvalidUsageError: when the number of column_settings does not match the number of
|
|
503
|
+
columns in each row.
|
|
504
|
+
InvalidUsageError: when the number of rows is greater than 100.
|
|
505
|
+
InvalidUsageError: when the number of columns in a row is greater than 20.
|
|
506
|
+
InvalidUsageError: when the number of column_settings is greater than 20.
|
|
502
507
|
"""
|
|
503
508
|
|
|
504
509
|
def __init__(
|
|
@@ -22,7 +22,7 @@ class RichTextElementType(Enum):
|
|
|
22
22
|
LINK = "link"
|
|
23
23
|
TEXT = "text"
|
|
24
24
|
USER = "user"
|
|
25
|
-
USER_GROUP = "
|
|
25
|
+
USER_GROUP = "usergroup"
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class RichTextElement(ABC):
|
|
@@ -333,7 +333,7 @@ class RichTextUserGroup(RichTextElement):
|
|
|
333
333
|
|
|
334
334
|
def _resolve(self) -> Dict[str, Any]:
|
|
335
335
|
user_group = super()._resolve()
|
|
336
|
-
user_group["
|
|
336
|
+
user_group["usergroup_id"] = self.user_group_id
|
|
337
337
|
style = {}
|
|
338
338
|
if self.bold is not None:
|
|
339
339
|
style["bold"] = self.bold
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|