Metadata-Version: 2.5
Name: notifiers
Version: 2.0.0
Summary: The easy way to send notifications
Project-URL: Homepage, https://github.com/liiight/notifiers
Project-URL: Repository, https://github.com/liiight/notifiers
Project-URL: Documentation, https://notifiers.readthedocs.io/en/latest/
Author-email: liiight <python.notifiers@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: email,messaging,notifications,push
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Python: >=3.10
Requires-Dist: click>=8.0.3
Requires-Dist: pydantic<3,>=2.7
Requires-Dist: requests<3,>=2.27.1
Description-Content-Type: text/markdown

![Full logo](https://raw.githubusercontent.com/liiight/notifiers/main/assets/images/circle_full_logo.png)

[![Tests](https://img.shields.io/github/actions/workflow/status/liiight/notifiers/pythonpackage.yml?branch=main&label=tests&style=flat-square)](https://github.com/liiight/notifiers/actions/workflows/pythonpackage.yml?query=branch%3Amain) [![PyPi version](https://img.shields.io/pypi/v/notifiers.svg?style=flat-square) ](https://pypi.python.org/pypi/notifiers) [![Supported Python versions](https://img.shields.io/pypi/pyversions/notifiers.svg?style=flat-square) ](https://pypi.org/project/notifiers) [![License](https://img.shields.io/pypi/l/notifiers.svg?style=flat-square) ](https://choosealicense.com/licenses) [![Status](https://img.shields.io/pypi/status/notifiers.svg?style=flat-square) ](https://pypi.org/project/notifiers/) [![Docker image](https://img.shields.io/badge/ghcr.io-liiight%2Fnotifiers-blue?logo=docker&logoColor=white&style=flat-square)](https://github.com/liiight/notifiers/pkgs/container/notifiers) [![RTD](https://img.shields.io/readthedocs/notifiers.svg?style=flat-square) ](https://readthedocs.org/projects/notifiers/badge/?version=latest) [![Paypal](https://img.shields.io/badge/Donate-PayPal-green.svg?style=flat-square) ](https://paypal.me/notifiers) [![PyPI Downloads](https://static.pepy.tech/personalized-badge/notifiers?period=total&units=INTERNATIONAL_SYSTEM&left_color=GREY&right_color=GREEN&left_text=downloads)](https://pepy.tech/projects/notifiers)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/liiight?style=social)](https://twitter.com/liiight)


See [changelog](http://notifiers.readthedocs.io/en/latest/changelog.html) 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](https://pushover.net/), [SimplePush](https://simplepush.io/), [Slack](https://api.slack.com/), [Gmail](https://www.google.com/gmail/about/), Email (SMTP), [Telegram](https://telegram.org/), [Pushbullet](https://www.pushbullet.com), [Join](https://joaoapps.com/join/), [Zulip](https://zulipchat.com/), [Twilio](https://www.twilio.com/), [Pagerduty](https://www.pagerduty.com), [Mailgun](https://www.mailgun.com/), [StatusPage.io](https://statuspage.io), [iCloud](https://www.icloud.com/mail), [VictorOps (Splunk)](https://www.splunk.com/en_us/investor-relations/acquisitions/splunk-on-call.html), [Notify](https://github.com/K0IN/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](https://pypi.org/project/requests/), [pydantic](https://pypi.org/project/pydantic/) and [click](https://pypi.org/project/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

Requires Python 3.10 or newer.

As a library, add it to your project with [uv](https://docs.astral.sh/uv/):
```
$ uv add notifiers
```

To use the CLI, run it with `uvx` without installing anything:
```
$ uvx notifiers --help
```
Or install the `notifiers` command once:
```
$ uv tool install notifiers
```

Via pip:
```
$ pip install notifiers
```
Via homebrew:
```
$ brew install notifiers
```
Or run the CLI with Docker:
```
$ docker run --rm ghcr.io/liiight/notifiers pushover notify --user foo --token baz "This is so easy!"
```
# Basic Usage

```python
>>> from notifiers import get_notifier
>>> p = get_notifier('pushover')
>>> p.required
{'required': ['user', 'message', 'token']}
>>> p.notify(user='foo', token='bar', message='test')
<Response,provider=Pushover,status=Success, errors=None>
```

Or:
```python
>>> from notifiers import notify
>>> notify('pushover', user='foo', token='bar', message='test')
<Response,provider=Pushover,status=Success, errors=None>
```

# From CLI

```text
$ uvx notifiers pushover notify --user foo --token baz "This is so easy!"
```

Or, after `uv tool install notifiers`:
```text
$ notifiers pushover notify --user foo --token baz "This is so easy!"
```

# As a logger

Directly add to your existing stdlib logging:

```python
>>> 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](https://pythonbytes.fm/episodes/show/67/result-of-moving-python-to-github) podcast

# Road map

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

See [Docs](http://notifiers.readthedocs.io/) 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](https://paypal.me/notifiers) ☕

# 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.](https://www.pypa.io/en/latest/code-of-conduct/)
