An easy-to-use python library for the ntfy notification service. Aiming for full feature support and a super easy to use interface.
- 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 tohttps://ntft.sh
)
- Setup your application to use the library:
# Import the ntfy client
from python_ntfy import NtfyClient
# Create an `NtfyClient` instance with a topic
client = NtfyClient(topic="Your topic")
# Send a message
client.send("Your message here")
See the full documentation at https://matthewcane.github.io/python-ntfy/.
- Username + password auth
- Access token auth
- Custom servers
- Sending plaintext messages
- Sending Markdown formatted text messages
- Scheduling messages
- Retrieving cached messages
- Scheduled delivery
- Tags
- Action buttons
- Email notifications
- Send to multiple topics at once
This project uses:
- Poetry as it's dependency manager
- Just as a task runner
- Pre-commit for running checks before each commit
- Docker and Docker Compose for running tests
These need to be installed separately to run the tasks.
To see all available tasks, run just
.
Some useful tasks are:
just install
- Install dependencies (including dev dependencies)just test
- Run all tests and checksjust serve-docs
- Build and serve the docs locally
This project is aiming for 95% code coverage. Any added features must include comprehensive tests.