module documentation
Minimal helper for sending notifications to mobile devices via the Pushover API.
- Documentation:
- https://pushover.net/api
Example
from PushoverClient import PushoverClient, sendNotification
sendNotification(
token="YOUR_APP_TOKEN",
user="YOUR_USER_KEY",
message="a message",
title="a title",
)
# Reusable client (avoids passing token/user each time)
client = PushoverClient(token='YOUR_APP_TOKEN', user='YOUR_USER_KEY')
client.sendNotification('Disk usage above 90%', title='Alert', priority=1, sound='siren')
| Class | |
A client for sending notifications to mobile devices via the Pushover API. |
| Exception | |
Raised when the Pushover API rejects a request or returns an error. |
| Function | send |
Convenience one-off call - builds a client and sends immediately. |
| Constant | PUSHOVER |
URL for the Pushover API endpoint to send messages. |
Convenience one-off call - builds a client and sends immediately.
| Parameters | |
token:str | Application/API token. |
user:str | User or group key. |
message:str | The message to send (max 1024 characters). |
**kwargs:Any | Additional keyword arguments for PushoverClient.sendNotification(). |
| Returns | |
dict | Parsed JSON response from the Pushover API. |
| Raises | |
PushoverError | If the API returns an error or a non-200 status code |