Skip to main content

Easily send notifications everywhere

Project description

Full logo Travis CI Codecov https://img.shields.io/gitter/room/nwjs/nw.js.svg?style=flat-square PyPi version Supported Python versions License Status Docker build RTD Paypal Twitter Follow

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

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, requests-toolbelt, 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

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>

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!')

In the near future

  • Many more providers

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

Why python 3 only?

I wanted to avoid the whole unicode issue fiasco if possible, but there isn’t a real constraint in adding python 2 support. If there’s an overwhelming desire for this, i’ll do it. Probably.

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. ☕

Project details


Download files

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

Source Distribution

notifiers-0.7.1.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

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

notifiers-0.7.1-py3-none-any.whl (44.4 kB view details)

Uploaded Python 3

File details

Details for the file notifiers-0.7.1.tar.gz.

File metadata

  • Download URL: notifiers-0.7.1.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for notifiers-0.7.1.tar.gz
Algorithm Hash digest
SHA256 f9d2299912bf882ed9f44605663670f070e78b8011646c3c9e618fcd17f531af
MD5 b63e18e1d309dcc26525fa30d9ca1749
BLAKE2b-256 606210852ef24e1b1badeec7f54640f4446cc7903153f05b4225f97db76204b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for notifiers-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 27631c4aa61c241b0e40bbcbccfef4af7bf808d36feaf5e342cdd6f077e81b2d
MD5 df8d3b44a024c9c1855bbd0b5dc7ae84
BLAKE2b-256 fa9b7287f677e845593c585b16b96ec98c6e4210ef4eee14f1c94e24dace98a3

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