ntfy.backends package

Submodules

ntfy.backends.darwin module

ntfy.backends.darwin.notify(title, message, retcode=None)

adapted from https://gist.github.com/baliw/4020619

ntfy.backends.default module

exception ntfy.backends.default.DefaultNotifierError(exception, module)

Bases: Exception

ntfy.backends.default.notify(title, message, **kwargs)

This backend automatically selects the correct desktop notification backend for your operating system.

ntfy.backends.linux module

ntfy.backends.linux.notify(title, message, icon='/home/docs/.local/share/ntfy/icon.png', urgency=None, transient=None, retcode=0)

ntfy.backends.pushbullet module

ntfy.backends.pushbullet.notify(title, message, access_token, device_iden=None, email=None, retcode=None)
Required parameter:
Optional parameters:
  • device_iden - a device identifier, if omited, notification is
    sent to all devices
  • email - send notification to pushbullte user with the specified
    email or send an email if they aren’t a pushullet user

ntfy.backends.pushover module

ntfy.backends.pushover.notify(title, message, user_key, api_token='aUnsraBiEZVsmrG89AZp47K3S2dX2a', device=None, sound=None, priority=0, expire=None, retry=None, callback=None, url=None, url_title=None, html=False, retcode=None)
Required parameters:
  • user_key
Optional parameters:
  • sound
  • priority
  • expire
  • retry
  • callback
  • api_token - use your own application token
  • device - target a device, if omitted, target all devices
  • url
  • url_title
  • html

ntfy.backends.simplepush module

ntfy.backends.simplepush.notify(title, message, key, event=None, retcode=None)
Required paramter:
  • key - The Simplepush identification key, created by

installing the Android App (https://simplepush.io)

Optional parameters:
  • event - use custom ringtones and vibration patterns

ntfy.backends.notifico module

ntfy.backends.notifico.notify(title, message, retcode=None, webhook=None)
Required parameter:
  • webhook - The webhook link, created at https://n.tkte.ch/
    (choose Plain Text service when creating the webhook)

ntfy.backends.insta module

exception ntfy.backends.insta.ApiException

Bases: Exception

exception ntfy.backends.insta.WrongMessageCountException

Bases: Exception

ntfy.backends.insta.notify(title, message, event_name, appid, secret, trackers, retcode=None)
Required parameter:
  • event_name - Instapush event (the notification template)
  • appid - The appid found on the dashboard
  • secret - The secret found on the dashboard
  • traskers - List of the placeholders for the selected event

ntfy.backends.win32 module

ntfy.backends.win32.notify(title, message, icon='/home/docs/.local/share/ntfy/icon.ico', retcode=None)
Optional parameters:
  • icon - path to an ICO file to display instead of the ntfy icon

ntfy.backends.xmpp module

class ntfy.backends.xmpp.NtfySendMsgBot(jid, password, recipient, title, message, mtype=None)

Bases: sleekxmpp.clientxmpp.ClientXMPP

Modified the commented sleekxmpp example: http://sleekxmpp.com/getting_started/sendlogout.html

NOTE: supplying mtype=’chat’ was required for
Google Hangouts to work
start(event)
ntfy.backends.xmpp.notify(title, message, jid, password, recipient, hostname=None, port=5222, path_to_certs=None, mtype=None, retcode=None)
Optional parameters
  • hostname (if not from jid)
  • port
  • path_to_certs
  • mtype (‘chat’ required for Google Hangouts)

To verify the SSL certificates offered by a server: path_to_certs = “path/to/ca/cert”

Without dnspython library installed, you will need to specify the server hostname if it doesn’t match the jid.

For example, to use Google Talk you would need to use: hostname = ‘talk.google.com’

Specify port if other than 5222. NOTE: Ignored without specified hostname

ntfy.backends.systemlog module

ntfy.backends.systemlog.notify(title, message, prio='ALERT', facility='LOCAL5', fmt='[{title}] {message}', retcode=None)

Uses the syslog core Python module, which is not available on Windows platforms.

Optional parameters:
  • prio - Syslog prority level. Default is ALERT. Possible values are:
    • EMERG
    • ALERT
    • CRIT
    • ERR
    • WARNING
    • NOTICE
    • INFO
    • DEBUG
  • facility - Syslog facility. Default is LOCAL5. Possible values are:
    • KERN
    • USER
    • MAIL
    • DAEMON
    • AUTH
    • LPR
    • NEWS
    • UUCP
    • CRON
    • SYSLOG
    • LOCAL0
    • LOCAL1
    • LOCAL2
    • LOCAL3
    • LOCAL4
    • LOCAL5
    • LOCAL6
    • LOCAL7
  • fmt - Format of the message to be sent to the system logger. The title and the message are specified using the following placeholders:

    • {title}
    • {message}

    Default is [{title}] {message}.

ntfy.backends.rocketchat module

ntfy.backends.rocketchat.notify(title, message, url, username, password, room, retcode=None)

Module contents