Quickstart Guide
- Install using pip with
pip3 install python-ntfy
- Configure the following environment variables:
NTFY_USER
: The username for your server (if required)
NTFY_PASSWORD
: The password for your server (if required)
NTFY_SERVER
: The server URL (defaults to https://ntft.sh
)
- Setup your application to use the library:
# Import the ntfy client
from python_ntfy import NtfyClient
# Optionally set your environment variables
from os import environ
environ["NTFY_USER"] = "your_username"
environ["NTFY_PASSWORD"] = "your_password"
# Create an `NtfyClient` instance with a topic
client = NtfyClient(topic="Your topic")
# Send a message
client.send("Your message here")