Prefect integrations with Slack
Project description
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.
Installation
Install prefect-slack
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 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 guide provides additional details on setting up a Slack app.
Write and run a flow
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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file prefect_slack-0.3.1.tar.gz
.
File metadata
- Download URL: prefect_slack-0.3.1.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3eaa9dd997c1be96d9601b7a1dbfb57f7e9a40d7208b22b6c5cdc0579be13b21 |
|
MD5 | cf5d1870ddd509a9c67f5ea13f63feda |
|
BLAKE2b-256 | 8c580506e132aaead9a0c4d6adf3d547d8e1fd1010053b0c0a8ba76db419f0eb |
Provenance
The following attestation bundles were made for prefect_slack-0.3.1.tar.gz
:
Publisher:
integration-package-release.yaml
on PrefectHQ/prefect
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
prefect_slack-0.3.1.tar.gz
- Subject digest:
3eaa9dd997c1be96d9601b7a1dbfb57f7e9a40d7208b22b6c5cdc0579be13b21
- Sigstore transparency entry: 149130338
- Sigstore integration time:
- Predicate type:
File details
Details for the file prefect_slack-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: prefect_slack-0.3.1-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84067ef89c9085fd991943747e4943accb3fe586a9401355180bb50dac5dab21 |
|
MD5 | 386a34df509d08108e1f5d89d7e7bec4 |
|
BLAKE2b-256 | 41126b095a290517abd605875be2a746d222a95d0296d44ff81f56fc93a32eac |
Provenance
The following attestation bundles were made for prefect_slack-0.3.1-py3-none-any.whl
:
Publisher:
integration-package-release.yaml
on PrefectHQ/prefect
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
prefect_slack-0.3.1-py3-none-any.whl
- Subject digest:
84067ef89c9085fd991943747e4943accb3fe586a9401355180bb50dac5dab21
- Sigstore transparency entry: 149130340
- Sigstore integration time:
- Predicate type: