Client and framework for receiving notifications via Pushover
Project description
python-pushover-open-client
Command line app and framework for receiving and processing Pushover push notifications in real time.
Features
Receive notifications real time via Pushover websocket server.
Execute python funcions via commands received by notification, passing arguments as *args.
Execute shell commands, passing arguments.
Execute python functions to all received notifications (eg.,. you can use Popen to send all notifications to notify-send.)
Can be run as a system service, enabling your scripts from boot time.
It is being developed with facilities to make it easy subclassing.
Installing
pip install python-pushover-open-client
Python minimum version 3.10 is needed. (because of the `|` union annotations.)
Setting Up
The script expects a file at the home directory named ~/.pushover-open-client-creds.json. The file should be a JSON file with account’s email and password, this way:
file: ~/.pushover-open-client-creds.json
{ "email": "USERS@EMAIL.ETC", "password": "M4HSUP3RBPASS" }
Given the above, by logging and getting an auth secret, a new device will be created wielding it’s device_id, and that file will be updated containing all these four values.
Using
Programatically
Soon.. Example is better. Decorators @register_command etc .
A Little More Inner
This package is based in two classes, some decorators to register functions from user scripts, some functions to register other stuff to be executed by notifications.
The two classes are python_pushover_open_client.PushoverOpenClient and python_pushover_open_client.PushoverOpenClientRealTime. The first manages credentials, authentication, device registration, message downloading, message deletion etc, like specified by the Pushover Open Client API documentation, and is consumed by the second class. The second class connects to the Pushover’s websocket server with the given credentials (secret and device_id) and keep the connection open, receiving messages and executing callbacks when and according to each server message is received.
By now, decorators and top level functions are used to register functions to be executed when certain commands are received by notification (@register_command, @register_command_parser, register_shell_command(), register_shell_command_alias()), or to register parsers which will be executed when every notification is received @register_parser.)
Contributing
Please open an issue if you want to contribute with code. Or use discussions.
Support
You can open a issue or a message in discussions for support in using/getting the code.
Is it ready already?
100%
Note
This project has been set up using PyScaffold 4.1.4. For details and usage information on PyScaffold see https://pyscaffold.org/.
Project details
Release history Release notifications | RSS feed
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
Hashes for python-pushover-open-client-0.0.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7c8dd57adfb208f9c9501719f81e9064bfc3cf05a7d17f4c88c96daa5b6e474 |
|
MD5 | 2311c2abc234d68f562ca1e9d87832f9 |
|
BLAKE2b-256 | 4fb5cbac67eb671c3fd35f7a1b53fd42ac73ad9feeff01d5bb9124c68e99e011 |
Hashes for python_pushover_open_client-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b17eaabcb0227b66ae0f2399666fe031b83c17be6194029cf4d9b95566cd74d6 |
|
MD5 | 189e2d3fb0a947b5117c3e851cb0bc3c |
|
BLAKE2b-256 | 1cb0dc261c09b7db60e5995eb81bbe29bb7953ac20dcb2731f0fa6146f3deee4 |