Skip to main content

ntfy-notify

Installation

Using pip

pip install ntfy-notify

Using Poetry

poetry add ntfy-notify

Configuration

Create a configuration file at ~/.config/ntfy-notify/config.toml with your ntfy credentials:

# Required: Your ntfy server URL
server = "https://ntfy.server"

# Required: Your access token (if using ntfy with authentication)
token = "your_token_here"

# Required: Default topic to send notifications to
default_topic = "your_topic_here"

# Optional: Default message priority (default: "default")
# Valid values: "min", "low", "default", "high", "max"
default_priority = "default"

Usage

Python API

from ntfy_notify.core import send_notification

# Basic notification
send_notification("Hello from Python!")

# With title and priority
send_notification(
    "This is an important message",
    title="Important Update",
    priority="high"
)

# With custom topic
send_notification("This goes to a custom topic", topic="custom_topic")

# With additional options
send_notification(
    "Check out our website!",
    title="Website",
    click_url="https://example.com",
    tags=["globe_with_meridians", "link"]
)

Command Line Interface

ntfy_notify    --message "${BASH_SOURCE}:33 message" \
    --topic "topic" \
	--title "title" \
	--priority "default" \
	--tags "test_tube, building_construction" \
	--click "https://server.com/click" \
    --actions "view, act1, https://server.com/act1; \
       view, act2, https://server.com/act2"

If you want to run ntfy-notify as a root user, you may call it with the explicit path to the python interpreter:

# get the path
which ntfy_notify

# run with sudo
sudo /path/to/python/ntfy_notify --message "Test message" --topic "topic" --title "Test Title" --priority "default" --tags "test" --click "https://example.com"

Command Line Options

Usage: ntfy_notify [OPTIONS] [MESSAGE]

  Send a notification via ntfy

  If MESSAGE is not provided, reads from stdin.

Options:
  -m, --message TEXT       The message to send (required if not reading from
                          stdin)
  -t, --topic TEXT         Topic to send to (overrides config)
  --title TEXT             Message title
  -p, --priority [min|low|default|high|max]
                          Message priority
  --click-url TEXT         URL to open when notification is clicked
  --tags TEXT              Comma-separated list of tags/emojis
  --config FILE            Path to config file
  --version                Show the version and exit.
  --timeout INTEGER        Timeout in seconds
  --help                   Show this message and exit.

License

This project is licensed under the EUPL-1.2 - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Running Tests

The test suite uses pytest and can be run with:

# Install test dependencies
poetry install --with test

# Run tests
poetry run pytest -v tests/

Development

  1. Clone the repository
  2. Install dependencies:
    poetry install
    
  3. Create a test configuration file at ~/.config/ntfy-notify/config.toml
  4. Run tests to verify your setup

License

EUPL-1.2

Metadata

Release files for ntfy-notify 0.1.8

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-notify 0.1.8
File Size Uploaded Provenance Actions
ntfy_notify-0.1.8.tar.gz 9.1 kB Without provenance Details for ntfy_notify-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ntfy-notify 0.1.8
File Interpreter ABI Platform Actions
ntfy_notify-0.1.8-py3-none-any.whl Python 3 none any Details for ntfy_notify-0.1.8-py3-none-any.whl

Total release size: 18.9 kB

Release files / ntfy_notify-0.1.8.tar.gz

Download URL ntfy_notify-0.1.8.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fed38fce416e51e2efe2b1e82dc9d86188376e3eceec573947b4268f6eb90ecb
BLAKE2b-256 checksum
How to use checksums
2141cab385d4b562ae6abfca9ad9a8542e9ab2294205768202277e0b3c66e6be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / ntfy_notify-0.1.8-py3-none-any.whl

Download URL ntfy_notify-0.1.8-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c93da30b020d43c39d8e2073420bf9ee0a2b2c7a9e4b1ea411a2bd0b8b215b0
BLAKE2b-256 checksum
How to use checksums
6d06291d2cfc0f7deb85820f083c7e19e8317260ece4a9cefea58cd4b7ccc4c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Security for ntfy-notify 0.1.8

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.

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