Watch command output and get notified on changes
Project description
watch-diff
Periodically run a command and receive nice diff styled emails on output changes.
See https://francisbergin.github.io/posts/watch-diff for more info.
Setup
pip install watch-diff
Features
- Supports Python >= 3.7
- Uses only Python Standard Library
- Sends email diff in both text and html form
- Output changes to CLI and optionally to SMTP
- Uses
Message-ID
andIn-Reply-To
to group email threads
Usage
$ watch-diff --help
usage: watch-diff [-h] [-v | -d] [-i SECONDS] [-r RECIPIENT] command
Watch command output and get notified on changes
positional arguments:
command the command to watch
optional arguments:
-h, --help show this help message and exit
-i SECONDS, --interval SECONDS
number of seconds between executions
-r RECIPIENT, --recipient RECIPIENT
send email to recipient
logging level:
-v, --verbose enable verbose output
-d, --debug show debugging statements
Credentials
export SMTP_HOST=qwer.ty
export SMTP_PORT=1234
export SMTP_USER=qwer@qwer.ty
read -s -p "SMTP_PASS: " SMTP_PASS
export SMTP_PASS
Development
# setup
python3 -m venv venv && . venv/bin/activate
# editable install
pip install -e .[dev]
# running tests
python -m unittest -v
# running tests for all supported python versions
tox
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
watch-diff-1.1.4.tar.gz
(6.9 kB
view hashes)
Built Distribution
Close
Hashes for watch_diff-1.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07b5f87eeaf186715391da43fbf09d2eef1cd21d1bf9222104e9313b95fd0430 |
|
MD5 | b71d9790c07a2548a74856c7bf0cb20f |
|
BLAKE2b-256 | a63c7ed6b1c22825d8a1dff5d5516cc0934c5e44a7b130859cdd39e583658d43 |