Name | prefect-slack JSON |
Version |
0.3.1
JSON |
| download |
home_page | None |
Summary | Prefect integrations with Slack |
upload_time | 2024-11-15 17:17:29 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | Apache License 2.0 |
keywords |
prefect
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# prefect-slack
## Welcome!
`prefect-slack` is a collection of prebuilt Prefect tasks that can be used to quickly construct Prefect flows.
## Getting Started
### Python setup
Requires an installation of Python 3.9+
We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.
These tasks are designed to work with Prefect 2.0. For more information about how to use Prefect, please refer to the [Prefect documentation](https://docs.prefect.io/).
### Installation
Install `prefect-slack`
```bash
pip install prefect-slack
```
### Slack setup
In order to use tasks in the collection, you'll first need to create an Slack app and install it in your Slack workspace. You can create a Slack app by navigating to the [apps page](https://api.slack.com/apps) for your Slack account and selecting 'Create New App'.
For tasks that require a Bot user OAuth token, you can get a token for your app by navigating to your apps __OAuth & Permissions__ page.
For tasks that require and Webhook URL, you get generate new Webhook URLs by navigating to you apps __Incoming Webhooks__ page.
Slack's [Basic app setup](https://api.slack.com/authentication/basics) guide provides additional details on setting up a Slack app.
### Write and run a flow
```python
from prefect import flow
from prefect.context import get_run_context
from prefect_slack import SlackCredentials
from prefect_slack.messages import send_chat_message
@flow
def example_send_message_flow():
context = get_run_context()
# Run other tasks and subflows here
token = "xoxb-your-bot-token-here"
send_chat_message(
slack_credentials=SlackCredentials(token),
channel="#prefect",
text=f"Flow run {context.flow_run.name} completed :tada:"
)
example_send_message_flow()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "prefect-slack",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "prefect",
"author": null,
"author_email": "\"Prefect Technologies, Inc.\" <help@prefect.io>",
"download_url": "https://files.pythonhosted.org/packages/8c/58/0506e132aaead9a0c4d6adf3d547d8e1fd1010053b0c0a8ba76db419f0eb/prefect_slack-0.3.1.tar.gz",
"platform": null,
"description": "# prefect-slack\n\n## Welcome!\n\n`prefect-slack` is a collection of prebuilt Prefect tasks that can be used to quickly construct Prefect flows.\n\n## Getting Started\n\n### Python setup\n\nRequires an installation of Python 3.9+\n\nWe recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.\n\nThese tasks are designed to work with Prefect 2.0. For more information about how to use Prefect, please refer to the [Prefect documentation](https://docs.prefect.io/).\n\n### Installation\n\nInstall `prefect-slack`\n\n```bash\npip install prefect-slack\n```\n\n### Slack setup\n\nIn order to use tasks in the collection, you'll first need to create an Slack app and install it in your Slack workspace. You can create a Slack app by navigating to the [apps page](https://api.slack.com/apps) for your Slack account and selecting 'Create New App'.\n\nFor tasks that require a Bot user OAuth token, you can get a token for your app by navigating to your apps __OAuth & Permissions__ page.\n\nFor tasks that require and Webhook URL, you get generate new Webhook URLs by navigating to you apps __Incoming Webhooks__ page.\n\nSlack's [Basic app setup](https://api.slack.com/authentication/basics) guide provides additional details on setting up a Slack app.\n\n### Write and run a flow\n\n```python\nfrom prefect import flow\nfrom prefect.context import get_run_context\nfrom prefect_slack import SlackCredentials\nfrom prefect_slack.messages import send_chat_message\n\n\n@flow\ndef example_send_message_flow():\n context = get_run_context()\n\n # Run other tasks and subflows here\n\n token = \"xoxb-your-bot-token-here\"\n send_chat_message(\n slack_credentials=SlackCredentials(token),\n channel=\"#prefect\",\n text=f\"Flow run {context.flow_run.name} completed :tada:\"\n )\n\nexample_send_message_flow()\n```\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Prefect integrations with Slack",
"version": "0.3.1",
"project_urls": {
"Homepage": "https://github.com/PrefectHQ/prefect/tree/main/src/integrations/prefect-slack"
},
"split_keywords": [
"prefect"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "41126b095a290517abd605875be2a746d222a95d0296d44ff81f56fc93a32eac",
"md5": "386a34df509d08108e1f5d89d7e7bec4",
"sha256": "84067ef89c9085fd991943747e4943accb3fe586a9401355180bb50dac5dab21"
},
"downloads": -1,
"filename": "prefect_slack-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "386a34df509d08108e1f5d89d7e7bec4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 10588,
"upload_time": "2024-11-15T17:17:27",
"upload_time_iso_8601": "2024-11-15T17:17:27.495017Z",
"url": "https://files.pythonhosted.org/packages/41/12/6b095a290517abd605875be2a746d222a95d0296d44ff81f56fc93a32eac/prefect_slack-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8c580506e132aaead9a0c4d6adf3d547d8e1fd1010053b0c0a8ba76db419f0eb",
"md5": "cf5d1870ddd509a9c67f5ea13f63feda",
"sha256": "3eaa9dd997c1be96d9601b7a1dbfb57f7e9a40d7208b22b6c5cdc0579be13b21"
},
"downloads": -1,
"filename": "prefect_slack-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "cf5d1870ddd509a9c67f5ea13f63feda",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 11710,
"upload_time": "2024-11-15T17:17:29",
"upload_time_iso_8601": "2024-11-15T17:17:29.282451Z",
"url": "https://files.pythonhosted.org/packages/8c/58/0506e132aaead9a0c4d6adf3d547d8e1fd1010053b0c0a8ba76db419f0eb/prefect_slack-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-15 17:17:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "PrefectHQ",
"github_project": "prefect",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "prefect-slack"
}