Skip to main content

A very small package that allows using Ntfy to send notifications

Project description

Mobiles notification

Following the Ntfy documentations we can create a docker container which will take care of all the underlying API for us. We simply run

sudo docker run -p 80:80 -itd binwiederhier/ntfy serve

You'll have to unstall the ntfy application, and change the default server to the address of your machine, then subscribe to a topic. Sending notifications can be done with curl

curl -d "Hello" 192.168.0.xxx/topic

Keep in mind this won't work for iphone devices.

Using the package

This is the example code provided in the notification.py script

from ntpy.Notification import *

# Before using this application the Ntfy server should
# be already running and everything is setup in the phone 
# side. Read the documentation for more informations
# https://docs.ntfy.sh/

# This function creates a Ntfy Client and will send
# notifications to the 'test' topic here
ntfy = Ntfy("test")

# Here we're setting up the notificaiton that we
# will be sending to the user
notification = Notification(
    message = "Your bot has lost 29$ trading today",
    priority = "urgent",
    tags = "warning",
    title = "Oh ooh..."
)

# And with this one line we send a notification to the user
ntfy.send(notification)

This code sends a simple notificaiton to your mobile device

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

ntfypy-0.0.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ntfypy-0.0.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file ntfypy-0.0.1.tar.gz.

File metadata

  • Download URL: ntfypy-0.0.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for ntfypy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b1214b2ae2ae1db8dcd874055efbb25efa745abd9b9bfd88bd2a3121982e470f
MD5 44b6ad825b7d130d4491148c63a7cc77
BLAKE2b-256 5bec1e6bd8825ccd3a4624242984eab0e72ddd24a65487e8fc34384146e6f3ec

See more details on using hashes here.

File details

Details for the file ntfypy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: ntfypy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for ntfypy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7663cd845800fc04b427c6cef45d51ceacefc3813810a99a122cff1ee0c7c95d
MD5 8e3b12a4c5b87d33d03dc81624f192b0
BLAKE2b-256 8d73069253c9574b0d4ba12002235429b10f0e0fc1230c0847db74da693d59af

See more details on using hashes here.

Supported by

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