Metadata-Version: 2.4
Name: triggerkit
Version: 0.0.1
Summary: Modular kit for trigger-based actions
Home-page: https://github.com/Datatistics/triggerkit
Author: Cooper Richason
Author-email: 144618753+cooper-richason@users.noreply.github.com
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: fastcore
Requires-Dist: nbdev
Requires-Dist: pandas
Requires-Dist: toml
Requires-Dist: snowflake-connector-python
Requires-Dist: schedule
Requires-Dist: apscheduler
Provides-Extra: dev
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# TriggerKit


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Overview

This system allows you to:

- Define Snowflake views to monitor
- Schedule when to check these views for new data
- Configure actions to trigger when data is available
- Extend with custom actions for your specific needs

### Installation

Install latest from the GitHub
[repository](https://github.com/Datatistics/triggerkit):

``` sh
$ pip install git+https://github.com/Datatistics/triggerkit.git
```

or from [pypi](https://pypi.org/project/triggerkit/)

``` sh
$ pip install triggerkit
```

## Usage

Run the system with your configuration file:

``` bash
# Using default config.toml in current directory
snowflake-actions

# Or specify a config file
snowflake-actions --config /path/to/your/config.toml

# To check your configuration file syntax
snowflake-actions --check-config

# To list available actions
snowflake-actions --list-actions

# For verbose logging
snowflake-actions --verbose
```

## Creating Custom Actions

You can extend the system with your own custom actions:

``` python
import triggerkit as tk

@tk.register("my_custom_action", "Description of what this action does")
def my_custom_action(data: List[Dict]):
    """
    Takes in records from Snowflake view and processes them how you want.
    
    Args:
        data: List of records from Snowflake
        
    Returns:
        Dictionary with action results
    """
    # Your custom logic here
    return {"processed": len(data)}
```

## Environment Variables

- `CONFIG_PATH`: Path to the TOML configuration file
- `SNOWFLAKE_PASSWORD`: Snowflake password (recommended over storing in
  config)
- `LOG_LEVEL`: Set the logging level (DEBUG, INFO, WARNING, ERROR)

## Built-in Actions

The system comes with several built-in actions:

- `send_alert`: Sends email and Slack notifications
- `log_incident`: Records incidents in a tracking system
- `generate_report`: Creates summary reports from data
