Welcome to Notifiers documentation!
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.
Click for a list of currently supported Providers. See latest changes in Changelog.
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, pydantic 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
Requires Python 3.10 or newer.
As a library, add it to your project with uv:
$ uv add notifiers
To use the CLI, run it with uvx without installing anything:
$ uvx notifiers --help
See Installation for more options (uv tool install, pip, homebrew, Docker with ghcr.io/liiight/notifiers).
Basic Usage
>>> from notifiers import get_notifier
>>> pushover = get_notifier('pushover')
>>> pushover.required
{'required': ['user', 'message', 'token']}
>>> pushover.notify(user='foo', token='bar', message='test')
<Response,provider=Pushover,status=Success, errors=None>
From CLI
$ uvx 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!')
Documentation
Providers documentation
API documentation
- API Documentation
- Core
SchemaResourceSchemaResource._get_environs()SchemaResource._merge_defaults()SchemaResource._normalize_keys()SchemaResource._prepare_data()SchemaResource._process_data()SchemaResource._validate_data()SchemaResource._validate_data_dependencies()SchemaResource.argumentsSchemaResource.create_response()SchemaResource.defaultsSchemaResource.nameSchemaResource.requiredSchemaResource.schemaSchemaResource.schema_model
ProviderProviderResourceResponseget_notifier()all_providers()get_all_providers()load_provider_from_points()get_providers_from_entry_points()notify()
- Logging
- Providers
SMTPSMTPSchemadefault_from()GmailGmailSchemaiCloudiCloudSchemaJoinJoinDevicesJoinDevicesSchemaJoinMixinJoinSchemaJoinSchema.alarm_volumeJoinSchema.api_keyJoinSchema.call_numberJoinSchema.clipboardJoinSchema.device_idJoinSchema.device_idsJoinSchema.device_namesJoinSchema.fileJoinSchema.findJoinSchema.groupJoinSchema.iconJoinSchema.imageJoinSchema.interruption_filterJoinSchema.media_volumeJoinSchema.messageJoinSchema.mms_fileJoinSchema.model_configJoinSchema.priorityJoinSchema.ring_volumeJoinSchema.small_iconJoinSchema.sms_numberJoinSchema.sms_textJoinSchema.titleJoinSchema.urlJoinSchema.wallpaper
PushbulletPushbulletDevicesPushbulletDevicesSchemaPushbulletMixinPushbulletSchemaPushbulletSchema.channel_tagPushbulletSchema.client_idenPushbulletSchema.device_idenPushbulletSchema.emailPushbulletSchema.guidPushbulletSchema.messagePushbulletSchema.model_configPushbulletSchema.source_device_idenPushbulletSchema.titlePushbulletSchema.tokenPushbulletSchema.type_PushbulletSchema.url
PushoverPushoverLimitsPushoverMixinPushoverResourceMixinPushoverResourceSchemaPushoverSchemaPushoverSchema.attachmentPushoverSchema.callbackPushoverSchema.devicePushoverSchema.expirePushoverSchema.htmlPushoverSchema.messagePushoverSchema.model_configPushoverSchema.priorityPushoverSchema.retryPushoverSchema.soundPushoverSchema.timestampPushoverSchema.titlePushoverSchema.tokenPushoverSchema.urlPushoverSchema.url_titlePushoverSchema.user
PushoverSoundsSimplePushSimplePushSchemaSlackSlackAttachmentSlackAttachment.author_iconSlackAttachment.author_linkSlackAttachment.author_nameSlackAttachment.colorSlackAttachment.fallbackSlackAttachment.fieldsSlackAttachment.footerSlackAttachment.footer_iconSlackAttachment.image_urlSlackAttachment.model_configSlackAttachment.pretextSlackAttachment.textSlackAttachment.thumb_urlSlackAttachment.titleSlackAttachment.title_linkSlackAttachment.ts
SlackAttachmentFieldSlackSchemaTelegramTelegramMixinTelegramSchemaTelegramUpdatesTelegramUpdatesSchemaZulipZulipSchemaTwilioTwilioSchemaTwilioSchema.account_sidTwilioSchema.application_sidTwilioSchema.auth_tokenTwilioSchema.from_TwilioSchema.max_priceTwilioSchema.media_urlTwilioSchema.messageTwilioSchema.messaging_service_idTwilioSchema.model_configTwilioSchema.provide_feedbackTwilioSchema.status_callbackTwilioSchema.toTwilioSchema.validity_period
PagerDutyPagerDutyImagePagerDutyLinkPagerDutySchemaPagerDutySchema.class_PagerDutySchema.componentPagerDutySchema.custom_detailsPagerDutySchema.dedup_keyPagerDutySchema.event_actionPagerDutySchema.groupPagerDutySchema.imagesPagerDutySchema.linksPagerDutySchema.messagePagerDutySchema.model_configPagerDutySchema.routing_keyPagerDutySchema.severityPagerDutySchema.sourcePagerDutySchema.timestamp
MailGunMailGunSchemaMailGunSchema.api_keyMailGunSchema.attachmentMailGunSchema.base_urlMailGunSchema.bccMailGunSchema.ccMailGunSchema.dataMailGunSchema.deliverytimeMailGunSchema.dkimMailGunSchema.domainMailGunSchema.from_MailGunSchema.headersMailGunSchema.htmlMailGunSchema.inlineMailGunSchema.messageMailGunSchema.model_configMailGunSchema.require_tlsMailGunSchema.skip_verificationMailGunSchema.subjectMailGunSchema.tagMailGunSchema.testmodeMailGunSchema.toMailGunSchema.trackingMailGunSchema.tracking_clicksMailGunSchema.tracking_opens
StatuspageStatuspageComponentsStatuspageComponentsSchemaStatuspageMixinStatuspageSchemaStatuspageSchema.api_keyStatuspageSchema.backfill_dateStatuspageSchema.backfilledStatuspageSchema.bodyStatuspageSchema.component_idsStatuspageSchema.deliver_notificationsStatuspageSchema.impact_overrideStatuspageSchema.messageStatuspageSchema.model_configStatuspageSchema.page_idStatuspageSchema.scheduled_auto_completedStatuspageSchema.scheduled_auto_in_progressStatuspageSchema.scheduled_forStatuspageSchema.scheduled_remind_priorStatuspageSchema.scheduled_untilStatuspageSchema.statusStatuspageSchema.wants_twitter_update
VictorOpsVictorOpsSchemaDingTalkDingTalkActionCardDingTalkAtDingTalkLinkDingTalkMarkdownDingTalkMessageDingTalkSchemaDingTalkTextNotifyNotifyMixinNotifySchema
- Exceptions
- Utils
- Core
Development documentation
Notifiers uses uv
$ uv sync && uv run pytest
To build the documentation:
$ uv run --group docs sphinx-build -W -b html source docs/_build
Donations
If you like this and want to buy me a cup of coffee, please click the donation button above or click this link ☕
Indices and tables