Skip to main content

An ntfy library aiming for feature completeness

Project description

A Python Library For ntfy

GitHub Release PyPI - Downloads GitHub Actions Workflow Status

An easy-to-use python library for the ntfy notification service. Aiming for full feature support and a super easy to use interface.

Quickstart

  1. Install using pip with pip3 install python-ntfy
  2. 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)
  3. 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

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

  1. Make sure you have docker and docker-compose installed
  2. Run the tests with poetry run pytest --cov or use the VSCode testing extension

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_ntfy-0.4.3.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

python_ntfy-0.4.3-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

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

Hashes for python_ntfy-0.4.3.tar.gz
Algorithm Hash digest
SHA256 f60d7cd87ee49641717009730299c933999837a7c6fbb7b9128b6538365ae24f
MD5 b08e7853af9b732b3bf7d3404db9a72a
BLAKE2b-256 24face8103150c3caaf0f932cb158368ada3e860bdc402e0a5c2b69ca4b4d2f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_ntfy-0.4.3.tar.gz:

Publisher: publish.yml on MatthewCane/python-ntfy

Attestations:

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

Hashes for python_ntfy-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 af3efccec380fce84d216d178103f4eee97780e0d6cddbff83714ab8e7f7c44d
MD5 bf6ef32020664d2451c97b6a55a5f3f5
BLAKE2b-256 2834410903519301178ceb246dd006ba7769cdc40fe3401b3965d653e8f0119a

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_ntfy-0.4.3-py3-none-any.whl:

Publisher: publish.yml on MatthewCane/python-ntfy

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page