Skip to main content

The easy way to send notifications

Project description

Full logo

Build StatusCodecov image PyPi version Supported Python versions License Status Docker build RTD Paypal Downloads Twitter Follow Code style: black Dependabot Status pre-commit

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

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

Road map

  • Many more providers!
  • Low level providers (Amazon SNS, Google FCM, OS Toast messages) via extra dependencies

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

notifiers-1.3.0-py3.9.egg (116.3 kB view details)

Uploaded Egg

notifiers-1.3.0-py3-none-any.whl (51.0 kB view details)

Uploaded Python 3

File details

Details for the file notifiers-1.3.0-py3.9.egg.

File metadata

  • Download URL: notifiers-1.3.0-py3.9.egg
  • Upload date:
  • Size: 116.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.56.0 CPython/3.7.0

File hashes

Hashes for notifiers-1.3.0-py3.9.egg
Algorithm Hash digest
SHA256 b1b907a32d036db4e116ef2b8dd9d9141760d398ad3040a4e2629a4e201d7d58
MD5 5d7bb9a4ef9fe3222b6dcde1dd6a0471
BLAKE2b-256 86b62a15e9c3a508fb9627e24e82865fbb08ad52e9a4d92259349b35f527fc0c

See more details on using hashes here.

File details

Details for the file notifiers-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: notifiers-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 51.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.56.0 CPython/3.7.0

File hashes

Hashes for notifiers-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d021d5bb222f665fe66e627641593607ed0fa86487b7066a5a34cb3893a8906
MD5 e15658f5127ed2fddef34c53e6606281
BLAKE2b-256 db685ae54fcda41562e8cebad37c1b422ed56e612c5c3a89dc55f9b512653ce4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page