Slack a messaging app for business that connects people to the information they need.
Resources that can be loaded using this verified source are:
| Name | Description |
|---|---|
| conversations | list the available conversations using the conversations.list endpoint. |
| history | get the conversation history using the conversations.history endpoint. |
| access_logs | get the team logs for the channel using team.accessLogs endpoint. |
dlt init slack duckdb
Here, we chose duckdb as the destination. Alternatively, you can also choose redshift, bigquery, or any of the other destinations.
Get your Slack access token. The process is detailed in the docs. You need to give the right scopes to the token.
Open .dlt/secrets.toml.
Enter the API access token:
[sources.slack] access_token="xoxp-*************-*************-*************-********************************"
Follow the instructions in the destinations document to add credentials for your chosen destination.
Install the necessary dependencies by running the following command:
pip install -r requirements.txt
Now the pipeline can be run by using the command:
python3 slack_pipeline.py
To make sure that everything is loaded as expected, use the command:
dlt pipeline slack_pipeline show
The slack source supports loading data from access_logs, conversations and history resources.
As access_logs is just available on paid accounts it needs to be manually enabled in the pipeline, as shown below.
source = slack_source() source.access_logs.selected = True
The conversations resource can be used to load the list of available conversations and will allways bring all the available conversations.
The history resource can be used to load the history of a conversation. By default all the conversations will be selected, but you can select only the ones you want using the selected_channels attribute.
source = slack_source(selected_channels=["welcome", "general"])
💡 To explore additional customizations for this pipeline, we recommend referring to the official dlt Chess documentation. It provides comprehensive information and guidance on how to further customize and tailor the pipeline to suit your specific needs. You can find the dlt Chess documentation in Setup Guide: Slack.