Skip to main content

Zero-Code automatic notifications for long-running Python scripts.

Project description

pynotify-auto 🚀

Zero-Code automatic notifications for long-running Python scripts.

Tired of checking your terminal every 5 minutes to see if your script finished? pynotify-auto automatically pings you (with a sound and a system notification) when any Python script runs for more than 5 seconds.

No code changes required. Just install and forget.

Features

  • Zero-Code Integration: Works automatically across your entire system/environment.
  • Smart Thresholding: Only pings if the script ran for a meaningful amount of time (default > 5s).
  • Cross-Platform: Works on Windows, macOS, and Linux.
  • Configurable: Change the threshold or disable it via environment variables.

Installation

Via Pip

pip install pynotify-auto

Via Conda

conda install -c conda-forge pynotify-auto

How it Works

The library uses a Python Path Configuration file (.pth) to register an atexit hook during Python startup. This allows it to monitor the execution time of any script without you having to import anything manually.

Configuration

You can customize the behavior using environment variables:

  • PYNOTIFY_MODE: Notification type. Options: popup (default), sound.
  • PYNOTIFY_THRESHOLD: Minimum execution time in seconds (default: 5.0).
  • PYNOTIFY_DISABLE: Set to 1 to disable notifications for a specific run.

Examples

# Only get a sound notification (no popup)
export PYNOTIFY_MODE=sound
python training.py

# Only notify if script takes longer than 10 minutes
export PYNOTIFY_THRESHOLD=600
python long_process.py

Command Line Interface (CLI)

Once installed, you can use the pynotify-auto command to test your settings:

  • pynotify-auto --test: Trigger a test notification.
  • pynotify-auto --info: View current mode and threshold settings.
  • pynotify-auto --help: Show all available commands.

License

MIT

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

pynotify_auto-0.1.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

pynotify_auto-0.1.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file pynotify_auto-0.1.1.tar.gz.

File metadata

  • Download URL: pynotify_auto-0.1.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pynotify_auto-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ac1bd78c89eb887775332a85aeca504f957c77fba62d59dc8557f269cde369cd
MD5 59d63eb550648e3025fbdbba77a68e28
BLAKE2b-256 216189589421a1f463cbaa60f46ba2c226fc4c716b4ecc69c92abe4d6fe212c0

See more details on using hashes here.

File details

Details for the file pynotify_auto-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pynotify_auto-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pynotify_auto-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60eb78396b2abdea57d203dca073f52735dfd2b421f1dadb3b21e005e5597090
MD5 0957ff7d2168b7d1ad2033772fce4c7e
BLAKE2b-256 a9f16c8de88189e807d10b1cf334be856e5abdbb462c671227880b2475ff39c9

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