Skip to main content

ntfy_catch

A cron-driven ntfy topic watcher that polls messages and dispatches them to a customizable handler script with AI classification support.

Installation

pip install ntfy_catch

Quick Start

  1. Initialize configuration (creates ~/.config/ntfy_catch/ with example files):

    ntfy_catch --init-config
    
  2. Configure your setup:

    • Edit ~/.config/ntfy_catch/ntfy_catch.ini:
      • Set your ntfy server URL
      • Configure topics to monitor
    • Customize ~/.config/ntfy_catch/handler.py with your own message handling logic
  3. Set up AI classification (optional):

    • Get an API key from OpenRouter
    • Save it to ~/.openrouter.key or set OPENROUTER_API_KEY environment variable
  4. Run:

    ntfy_catch                  # Poll for new messages
    ntfy_catch --dry-run        # Test without executing handler
    ntfy_catch --topic alerts   # Poll specific topic only
    
  5. Automate with cron:

    */5 * * * * /usr/local/bin/ntfy_catch
    

Features

  • Poll multiple ntfy topics for new messages
  • Filter by priority and tags
  • Dispatch messages to custom handler script (receives JSON on stdin)
  • AI-powered message classification (CALENDAR, TASK, MEMO, OTHER)
  • State tracking to avoid reprocessing messages
  • Configurable timeouts and error handling

Configuration

Config file location: ~/.config/ntfy_catch/ntfy_catch.ini

Key settings:

  • [server] base_url: Your ntfy server URL
  • [polling] topics: Comma-separated list of topics
  • [actions] handler_script: Path to your handler script
  • [filters] min_priority: Minimum priority level (1-5)

See ~/.config/ntfy_catch/ntfy_catch.ini (created by --init-config) for full documentation.

Handler Script

The handler receives message JSON on stdin and should exit with:

  • 0: Success (message marked as processed)
  • non-zero: Failure (message will be reprocessed on next run)

Customize ~/.config/ntfy_catch/handler.py to implement your own actions based on message content, tags, priority, etc.

Development

git clone <repo>
cd ntfy_catch
uv venv
source .venv/bin/activate
uv pip install -e .

License

See LICENSE file.

Metadata

Release files for ntfy_catch 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ntfy_catch 0.2.2
File Size Uploaded Provenance Actions
ntfy_catch-0.2.2.tar.gz 14.0 kB Without provenance Details for ntfy_catch-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ntfy_catch 0.2.2
File Interpreter ABI Platform Actions
ntfy_catch-0.2.2-py3-none-any.whl Python 3 none any Details for ntfy_catch-0.2.2-py3-none-any.whl

Total release size: 33.0 kB

Release files / ntfy_catch-0.2.2.tar.gz

Download URL ntfy_catch-0.2.2.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7b70fb69ebb14e3d9e698f73ad7d7f97297c45dd130be1fd1497f6e2ffbae21e
BLAKE2b-256 checksum
How to use checksums
4ad9f325bf99c463fd195e3f4e1b84385ea4b811ca3d8cfbb61075b35d65ecc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.7

Release files / ntfy_catch-0.2.2-py3-none-any.whl

Download URL ntfy_catch-0.2.2-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6c821ed6b786379ce1cb128567ba8f6899b3403b08badfac550b432f37a89cd
BLAKE2b-256 checksum
How to use checksums
049fb13a39a9ee16cac0c816aa1edc9a15d03afab891b3d982c505e2c0aae106
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.7

Security for ntfy_catch 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page