Skip to main content

Automated Data Alerts for Slack

Project description

auto-data-alerts

auto-data-alerts is a Python package that monitors Snowflake views and sends formatted alert messages to Slack channels. Point it at a view in your DATA_ALERTS schema, configure a template and channel, and it handles the rest — querying the data, formatting the message, sending to Slack, and logging the result.

Features

  • Snowflake integration — queries any view in your DATA_ALERTS schema, no boilerplate required
  • 5 message templates — from simple row-by-row lists to grouped data, metrics dashboards, and summary cards
  • Smart skipping — if a view returns no rows, the alert is skipped and the outcome is still logged
  • Alert history logging — every run (success or failure) is written back to Snowflake for auditing
  • Debug mode — set DEBUG=TRUE to redirect all messages to a test channel without changing any code

Installation

Install the latest version directly from GitHub:

pip install git+https://github.com/cooper-richason/auto-data-alerts.git

Or from PyPI:

pip install auto-data-alerts

Setup

The package reads credentials from environment variables. Set the following before running:

Variable Description
SNOWFLAKE_USER Snowflake username
SNOWFLAKE_PASSWORD Snowflake password
SNOWFLAKE_ACCOUNT Snowflake account identifier
SNOWFLAKE_WAREHOUSE Warehouse to use for queries
SNOWFLAKE_DATABASE Database containing the DATA_ALERTS schema
SLACK_BOT_TOKEN Slack Bot OAuth token (xoxb-...)
DEBUG Set to TRUE to route all messages to your test channel (optional)

How to use

The core function is send_alert. Call it with the Snowflake view name, a group label, a configuration dict, and the Slack channel ID:

from auto_data_alerts.core import send_alert

view_config = {
    'format_template': 'F1',          # which template to use
    'message_text': '@here, new alert:' # optional intro text
}

send_alert(
    view='my_alert_view',       # name of the Snowflake view in DATA_ALERTS schema
    view_group='my_team',       # prefix / team label used for titles and logging
    view_config=view_config,
    slack_channel='C01234ABCDE' # Slack channel ID
)

If the view returns no rows, the call returns early and logs a skipped result. If DEBUG=TRUE is set in the environment, the message is sent to your configured test channel instead.

See the full usage guide for complete setup instructions, Snowflake schema requirements, and configuration options.

Message Templates

Choose a template with the format_template key in view_config. All templates include a header derived from the view name and log the result to Snowflake.

Template Key Best for
F1 (default) 'F1' Row-by-row list with a label on the left and detail fields on the right
F2 'F2' Summary count and column stats with a “View Details” button
F3 'F3' Rows grouped by a category column, with optional per-group stats
F4 'F4' Metrics dashboard — configurable KPIs at the top, filtered critical alerts below
F5 'F5' Single-row view where each column becomes its own section block

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

auto_data_alerts-0.0.2.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

auto_data_alerts-0.0.2-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file auto_data_alerts-0.0.2.tar.gz.

File metadata

  • Download URL: auto_data_alerts-0.0.2.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for auto_data_alerts-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e155abfe69ec5718d7c1edbe01a580c1201f753883d32c9aa3daf872d203cc27
MD5 e6e67c835accabc78a16a51e5d2058c4
BLAKE2b-256 95581bde3499afd862b068b5a6a6515d2153e1d91f3c3f4ef9146530d499a1c7

See more details on using hashes here.

File details

Details for the file auto_data_alerts-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for auto_data_alerts-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 16bf3fbdc974476dcf26afd85758e7bd7e45fcd86eba5dbe94d63bb6599fa8b5
MD5 d1bb749d9f542f23b4f4a3612719ea24
BLAKE2b-256 4c6b6866413959311d3442fbf33efec743d90c7f4aa0a7de33b5b5f37427a684

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page