An ntfy library aiming for feature completeness
Project description
A Python Library For ntfy
An easy-to-use python library for the ntfy notification service. Aiming for full feature support and a super easy to use interface.
Quickstart
- 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")
Documentation
See the full documentation at https://matthewcane.github.io/python-ntfy/.
Supported Features
- 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
Future Features
- Email notifications
- Send to multiple topics at once
Testing and Development
This project uses:
- Poetry as it's dependency manager
- Ruff for linting and code formatting
- MyPy for static type checking
- Pre-Commit for running the above tools before committing
To install dev dependencies, run poetry install --with dev
.
To install pre-commit hooks, run pre-commit install
.
Linting, Formatting and Type Checking
These can be run with:
poetry run ruff format
poetry run ruff check
poetry run mypy .
These tools are also run in the CI pipeline and must pass before merging.
Tests
This project is aiming for 95% code coverage. Any added features must include comprehensive tests.
Testing Steps
- Make sure you have
docker
anddocker-compose
installed - Run the tests with
poetry run pytest --cov
or use the VSCode testing extension
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python_ntfy-0.4.3.tar.gz
.
File metadata
- Download URL: python_ntfy-0.4.3.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f60d7cd87ee49641717009730299c933999837a7c6fbb7b9128b6538365ae24f |
|
MD5 | b08e7853af9b732b3bf7d3404db9a72a |
|
BLAKE2b-256 | 24face8103150c3caaf0f932cb158368ada3e860bdc402e0a5c2b69ca4b4d2f0 |
Provenance
The following attestation bundles were made for python_ntfy-0.4.3.tar.gz
:
Publisher:
publish.yml
on MatthewCane/python-ntfy
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
python_ntfy-0.4.3.tar.gz
- Subject digest:
f60d7cd87ee49641717009730299c933999837a7c6fbb7b9128b6538365ae24f
- Sigstore transparency entry: 148154905
- Sigstore integration time:
- Predicate type:
File details
Details for the file python_ntfy-0.4.3-py3-none-any.whl
.
File metadata
- Download URL: python_ntfy-0.4.3-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af3efccec380fce84d216d178103f4eee97780e0d6cddbff83714ab8e7f7c44d |
|
MD5 | bf6ef32020664d2451c97b6a55a5f3f5 |
|
BLAKE2b-256 | 2834410903519301178ceb246dd006ba7769cdc40fe3401b3965d653e8f0119a |
Provenance
The following attestation bundles were made for python_ntfy-0.4.3-py3-none-any.whl
:
Publisher:
publish.yml
on MatthewCane/python-ntfy
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
python_ntfy-0.4.3-py3-none-any.whl
- Subject digest:
af3efccec380fce84d216d178103f4eee97780e0d6cddbff83714ab8e7f7c44d
- Sigstore transparency entry: 148154908
- Sigstore integration time:
- Predicate type: