Coder Social home page Coder Social logo

techiev2 / notifiers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liiight/notifiers

0.0 1.0 0.0 771 KB

The easy way to send notifications

Home Page: http://notifiers.readthedocs.io/

License: MIT License

Python 99.21% Makefile 0.30% Batchfile 0.40% Dockerfile 0.09%

notifiers's Introduction

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, Hipchat, 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.

notifiers's People

Contributors

liiight avatar dependabot-preview[bot] avatar pyup-bot avatar delirious-lettuce avatar darora-zipline avatar exequiel09 avatar jordansussman avatar recursing avatar grabear avatar gitter-badger avatar dpdani avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.