A simple library for sending notifications
Project description
PyNotifyYou
A simple library for sending notifications
Attention! I'm far from the most experienced or smart developer, so I'm not denying that my code can be pretty bad! I will always be glad to receive your advice on improving the code and ideas for implementation.
I also want to say that this is my first library, and most likely I will use quite a lot of old and crooked nonsense. Please don't blame me for this 👻
Navigation
Let's add some convenience for navigating through the repository:
Providers
I plan to implement support for several ways to receive notifications, and I will simply call them providers for convenience. 👌
At the moment, the project supports only one provider: Ntfy.sh
Installing
Okay, let's move on to the installation! In fact, the installation is no different from other libraries
You just need to install the library via pip:
pip install py_notify_you
Usage
And here it 's more interesting!
You can see the simplest option for sending notifications below.
Since the example uses Ntfy you need to perform the following steps:
To receive notifications, you must install the Ntfy app on your phone(Android,IOS) or install PWA!
Then click on the "+" button in the lower right corner to create a topic and get link (It will be needed in the future)
When creating, you will be required to enter the name of the topic, which will be a link, for example:
- The link Topic with the name PyNotifyMe will look like this - https://ntfy.sh/PyNotifyMe
- The link Topic with the name PythonStore will look like this - https://ntfy.sh/PythonStore
Now all that remains is to write the code! For the easiest way to send notifications, you can use the code below:
import py_notify_you
sender = py_notify_you.Ntfy("https://ntfy.sh/YourLink") # Here you should replace the link with your own
sender.send('Your message!')
DON'T FORGET TO CHANGE THE LINK
You can also add a header for your notification using the method set_title()
:
import py_notify_you
sender = py_notify_you.Ntfy("https://ntfy.sh/YourLink") # Here you should replace the link with your own
sender.set_title("Your title")
sender.send('Your message!')
More information can be found on the project's wiki
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 py_notify_you-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cab0fb3c5e706d75ffdf24b2f0c8be8c5cba8336f41be6edc50ee70f8e5e3a35 |
|
MD5 | ad66b727e57dbe07416121b966d56821 |
|
BLAKE2b-256 | 453a857cbc696137ed473d1f700e421800314f9388458f2d95984e626c49f1b6 |