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 NtfyPy.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.2.tar.gz (2.6 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.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ntfypy-0.0.2.tar.gz
  • Upload date:
  • Size: 2.6 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.2.tar.gz
Algorithm Hash digest
SHA256 bad494636f38c9fd128a17f52441e0a89daaa425725cb6c6452c59e9469ed85a
MD5 290fbf4b4950f7f655128e12a0ba073d
BLAKE2b-256 a4396673257eda81cd0d280d1515149a476a12126217a0b0e9263738d5194d24

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ntfypy-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c3f57b9272cebaef9b3f751bdbb146a4474a90cdc510735587789e91dd17ef75
MD5 d41d7dac1fb7ac98cfc5268e49e3a4c1
BLAKE2b-256 914822b33dc8deecc3488fc5de58a1441d0935c1d6a39167eef41b1bdb09bf78

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