prefect-slack


Nameprefect-slack JSON
Version 0.2.3 PyPI version JSON
download
home_pageNone
SummaryPrefect integrations with Slack
upload_time2024-04-25 19:22:03
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseApache 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.8+

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.8",
    "maintainer_email": null,
    "keywords": "prefect",
    "author": null,
    "author_email": "\"Prefect Technologies, Inc.\" <help@prefect.io>",
    "download_url": "https://files.pythonhosted.org/packages/56/db/75615a7938aeb7dc641fedf96c4c5c3b61e29ce7aaa7f41490ed1c5c2869/prefect_slack-0.2.3.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.8+\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.2.3",
    "project_urls": {
        "Homepage": "https://github.com/PrefectHQ/prefect/tree/main/src/integrations/prefect-slack"
    },
    "split_keywords": [
        "prefect"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "61374749d5994d45366aafa093baa0562eb85ff24d6192f97bc0e2048ab0c7b2",
                "md5": "8654b8e5d8c2d2627b2f78a0e554ee61",
                "sha256": "010f986aa8418ec81d80d55c1f764f68b7f200e27e34d648c2aaf75a1457fa3d"
            },
            "downloads": -1,
            "filename": "prefect_slack-0.2.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8654b8e5d8c2d2627b2f78a0e554ee61",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5319,
            "upload_time": "2024-04-25T19:22:02",
            "upload_time_iso_8601": "2024-04-25T19:22:02.451122Z",
            "url": "https://files.pythonhosted.org/packages/61/37/4749d5994d45366aafa093baa0562eb85ff24d6192f97bc0e2048ab0c7b2/prefect_slack-0.2.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "56db75615a7938aeb7dc641fedf96c4c5c3b61e29ce7aaa7f41490ed1c5c2869",
                "md5": "4e8330a2c051859f29d4c9d4445f99c0",
                "sha256": "3676ca68d0080cf23a8f0eb07a1270ccfd32bbea6542798b6a704401eb51636e"
            },
            "downloads": -1,
            "filename": "prefect_slack-0.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "4e8330a2c051859f29d4c9d4445f99c0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5631,
            "upload_time": "2024-04-25T19:22:03",
            "upload_time_iso_8601": "2024-04-25T19:22:03.661099Z",
            "url": "https://files.pythonhosted.org/packages/56/db/75615a7938aeb7dc641fedf96c4c5c3b61e29ce7aaa7f41490ed1c5c2869/prefect_slack-0.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-25 19:22:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PrefectHQ",
    "github_project": "prefect",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "circle": true,
    "requirements": [],
    "lcname": "prefect-slack"
}
        
Elapsed time: 0.25459s