See changelog for recent changes
Got an app or service, and you want to enable your users to use notifications with their provider of choice? Working on a script and you want to receive notification based on its output? You don't need to implement a solution yourself, or use individual provider libs. A one stop shop for all notification providers with a unified and simple interface.
Supported providers
Pushover, SimplePush, Slack, Gmail, Email (SMTP), Telegram, Gitter, Pushbullet, Join, Zulip, Twilio, Pagerduty, Mailgun, PopcornNotify, StatusPage.io, iCloud, VictorOps (Splunk), Notify
Advantages
- Spend your precious time on your own code base, instead of chasing down 3rd party provider APIs. That's what we're here for!
- With a minimal set of well known and stable dependencies (requests, jsonschema and click) you're better off than installing 3rd party SDKs.
- A unified interface means that you already support any new providers that will be added, no more work needed!
- Thorough testing means protection against any breaking API changes. We make sure your code your notifications will always get delivered!
Installation
Via pip:
$ pip install notifiers
Via homebrew:
$ brew install notifiers
Or Dockerhub:
$ docker pull liiight/notifiers
Basic Usage
>>> from notifiers import get_notifier
>>> p = get_notifier('pushover')
>>> p.required
{'required': ['user', 'message', 'token']}
>>> p.notify(user='foo', token='bar', message='test')
<NotificationResponse,provider=Pushover,status=Success>
Or:
>>> from notifiers import notify
>>> notify('pushover', user='foo', token='bar', message='test')
<NotificationResponse,provider=Pushover,status=Success>
From CLI
$ notifiers pushover notify --user foo --token baz "This is so easy!"
As a logger
Directly add to your existing stdlib logging:
>>> import logging
>>> from notifiers.logging import NotificationHandler
>>> log = logging.getLogger(__name__)
>>> defaults = {
'token': 'foo',
'user': 'bar'
}
>>> hdlr = NotificationHandler('pushover', defaults=defaults)
>>> hdlr.setLevel(logging.ERROR)
>>> log.addHandler(hdlr)
>>> log.error('And just like that, you get notified about all your errors!')
Mentions
- Mentioned in Python Bytes podcast
Road map
- Many more providers!
- Low level providers (Amazon SNS, Google FCM, OS Toast messages) via
extradependencies
See Docs for more information
Donations
If you like this and want to buy me a cup of coffee, please click the donation button above or click this link ☕
Code of Conduct
Everyone interacting in the Notifiers project's codebases, issue trackers and chat rooms is expected to follow the PyPA Code of Conduct.
Release files for notifiers 1.3.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| notifiers-1.3.6.tar.gz | 31.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| notifiers-1.3.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 78.7 kB
Release files / notifiers-1.3.6.tar.gz
| Download URL | notifiers-1.3.6.tar.gz |
|---|---|
| Size | 31.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
070d69dc34892b0675bdbca8529fb13d542f0c84052c6fef48fe2ab1d98d661f
|
|
BLAKE2b-256 checksum How to use checksums |
f2daa8c87ce1f82ed0a3940ff80cf74c2e565ffdf1e35aa1e981856f8dd8dc4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.3
|
Release files / notifiers-1.3.6-py3-none-any.whl
| Download URL | notifiers-1.3.6-py3-none-any.whl |
|---|---|
| Size | 47.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
137c54a5eeabcf5b672674d0a2fbaf072335bb6f5240a26d29ff387dbb043391
|
|
BLAKE2b-256 checksum How to use checksums |
525c44e2adf2df2118b468908d825ddcb00cf4f05f3ad4c5ef92d6738389cd89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.3
|