No project description provided
Project description
Snap Notify
A Python tool for sending notifications to Slack using a modular DSL template system. This tool allows you to define message templates in YAML format and send them to Slack channels with variable interpolation support.
Features
- 📝 YAML-based message templates
- 🔄 Variable interpolation using Jinja2
- 🧵 Support for threaded messages
- 🎯 Simple CLI interface
- 🔒 Secure token management
Installation
pip install snap-notify
Prerequisites
- Python 3.13 or higher
- A Slack Bot Token (set as
SLACK_BOT_TOKENenvironment variable)
Usage
1. Create a Message Template
Create a YAML file with your message template. Example:
channel: "#your-channel"
blocks:
- type: "section"
text: "Hello {{ name }}! Here's your daily update:"
- type: "context"
elements:
- type: "mrkdwn"
text: "Report generated at {{ timestamp }}"
interpolate:
name: "John"
timestamp: "2024-03-20 10:00:00"
2. Send the Message
Use the CLI to send your message:
snap-notify --file path/to/template.yaml
You can specify the template format using the --format or -t option:
snap-notify --file path/to/template.yaml --format yaml
# or using the short form
snap-notify -f path/to/template.yaml -t yaml
Currently supported formats:
yaml(default): YAML template format
Template Structure
The template supports the following fields:
channel: The Slack channel to send the message to (required)thread_ts: Thread timestamp for threaded messages (optional)blocks: Array of Slack block elementsinterpolate: Dictionary of variables for template interpolation
License
MIT License - see LICENSE for details.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file snap_notify-0.1.0.tar.gz.
File metadata
- Download URL: snap_notify-0.1.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.13.3 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c222c04211ace31bc1f9f7703da7cfcb2b539576f42560f80338a2d160b2f333
|
|
| MD5 |
86310c9894877fdc19a78f1c24e0b16e
|
|
| BLAKE2b-256 |
6fe5cf7d5432a6d029e3b5b7fcf94502b203be7e3afb26c7185a7f3c9b53bdb4
|
File details
Details for the file snap_notify-0.1.0-py3-none-any.whl.
File metadata
- Download URL: snap_notify-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.13.3 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0bcf28b68d291087683a88fec22fa3721d7329e62318a3d5eb41b1f3308840d
|
|
| MD5 |
5155e6e41574cfb1adb38d085e786a93
|
|
| BLAKE2b-256 |
19d8eaeac1c18289512b326baf635dd86139fb4e9056c6c77da0e5a637b539fe
|