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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ntfypy-0.0.3.tar.gz.
File metadata
- Download URL: ntfypy-0.0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac19a979eafc6608205bb7795bbec0068e16ce5869c85476a74fd7617ff85307
|
|
| MD5 |
b03ed2fb104ec927b5ca199ec58f25fd
|
|
| BLAKE2b-256 |
6066db0b48e256f9b51338f20b1f4db5efd8bd761a8cd057b63bd36ec423b5c4
|
File details
Details for the file ntfypy-0.0.3-py3-none-any.whl.
File metadata
- Download URL: ntfypy-0.0.3-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93acc8a444f4f48767a30f1daffdd7bdb597b6a2d6f0f3dd2daba5d3435263a2
|
|
| MD5 |
f596b850c73cf610dbebc1147198f7bb
|
|
| BLAKE2b-256 |
9673085b01fe8f2e772be04e064767cd55e30953b464b89f23ee5ead18153288
|