Coder Social home page Coder Social logo

caronc / apprise Goto Github PK

View Code? Open in Web Editor NEW
11.0K 67.0 390.0 6.6 MB

Apprise - Push Notifications that work with just about every platform!

Home Page: https://hub.docker.com/r/caronc/apprise

License: BSD 2-Clause "Simplified" License

Python 99.49% Roff 0.22% Shell 0.24% HTML 0.05%
notifications notification-hub notification-api python notification-service alerts notify push-notifications framework apprise

apprise's Introduction

Apprise Logo


ap·prise / verb
To inform or tell (someone). To make one aware of something.


Apprise allows you to send a notification to almost all of the most popular notification services available to us today such as: Telegram, Discord, Slack, Amazon SNS, Gotify, etc.

  • One notification library to rule them all.
  • A common and intuitive notification syntax.
  • Supports the handling of images and attachments (to the notification services that will accept them).
  • It's incredibly lightweight.
  • Amazing response times because all messages sent asynchronously.

Developers who wish to provide a notification service no longer need to research each and every one out there. They no longer need to try to adapt to the new ones that comeout thereafter. They just need to include this one library and then they can immediately gain access to almost all of the notifications services available to us today.

System Administrators and DevOps who wish to send a notification now no longer need to find the right tool for the job. Everything is already wrapped and supported within the apprise command line tool (CLI) that ships with this product.

Paypal Follow
Discord Python Build Status CodeCov Status PyPi

Table of Contents

Supported Notifications

The section identifies all of the services supported by this library. Check out the wiki for more information on the supported modules here.

Productivity Based Notifications

The table below identifies the services this tool supports and some example service urls you need to use in order to take advantage of it. Click on any of the services listed below to get more details on how you can configure Apprise to access them.

Notification Service Service ID Default Port Example Syntax
Apprise API apprise:// or apprises:// (TCP) 80 or 443 apprise://hostname/Token
AWS SES ses:// (TCP) 443 ses://user@domain/AccessKeyID/AccessSecretKey/RegionName
ses://user@domain/AccessKeyID/AccessSecretKey/RegionName/email1/email2/emailN
Bark bark:// (TCP) 80 or 443 bark://hostname
bark://hostname/device_key
bark://hostname/device_key1/device_key2/device_keyN
barks://hostname
barks://hostname/device_key
barks://hostname/device_key1/device_key2/device_keyN
Boxcar boxcar:// (TCP) 443 boxcar://hostname
boxcar://hostname/@tag
boxcar://hostname/device_token
boxcar://hostname/device_token1/device_token2/device_tokenN
boxcar://hostname/@tag/@tag2/device_token
Chantify chantify:// (TCP) 443 chantify://token
Discord discord:// (TCP) 443 discord://webhook_id/webhook_token
discord://avatar@webhook_id/webhook_token
Emby emby:// or embys:// (TCP) 8096 emby://user@hostname/
emby://user:password@hostname
Enigma2 enigma2:// or enigma2s:// (TCP) 80 or 443 enigma2://hostname
FCM fcm:// (TCP) 443 fcm://project@apikey/DEVICE_ID
fcm://project@apikey/#TOPIC
fcm://project@apikey/DEVICE_ID1/#topic1/#topic2/DEVICE_ID2/
Feishu feishu:// (TCP) 443 feishu://token
Flock flock:// (TCP) 443 flock://token
flock://botname@token
flock://app_token/u:userid
flock://app_token/g:channel_id
flock://app_token/u:userid/g:channel_id
Google Chat gchat:// (TCP) 443 gchat://workspace/key/token
Gotify gotify:// or gotifys:// (TCP) 80 or 443 gotify://hostname/token
gotifys://hostname/token?priority=high
Growl growl:// (UDP) 23053 growl://hostname
growl://hostname:portno
growl://password@hostname
growl://password@hostname:port
Note: you can also use the get parameter version which can allow the growl request to behave using the older v1.x protocol. An example would look like: growl://hostname?version=1
Guilded guilded:// (TCP) 443 guilded://webhook_id/webhook_token
guilded://avatar@webhook_id/webhook_token
Home Assistant hassio:// or hassios:// (TCP) 8123 or 443 hassio://hostname/accesstoken
hassio://user@hostname/accesstoken
hassio://user:password@hostname:port/accesstoken
hassio://hostname/optional/path/accesstoken
IFTTT ifttt:// (TCP) 443 ifttt://webhooksID/Event
ifttt://webhooksID/Event1/Event2/EventN
ifttt://webhooksID/Event1/?+Key=Value
ifttt://webhooksID/Event1/?-Key=value1
Join join:// (TCP) 443 join://apikey/device
join://apikey/device1/device2/deviceN/
join://apikey/group
join://apikey/groupA/groupB/groupN
join://apikey/DeviceA/groupA/groupN/DeviceN/
KODI kodi:// or kodis:// (TCP) 8080 or 443 kodi://hostname
kodi://user@hostname
kodi://user:password@hostname:port
Kumulos kumulos:// (TCP) 443 kumulos://apikey/serverkey
LaMetric Time lametric:// (TCP) 443 lametric://apikey@device_ipaddr
lametric://apikey@hostname:port
lametric://client_id@client_secret
Line line:// (TCP) 443 line://Token@User
line://Token/User1/User2/UserN
LunaSea lunasea:// (TCP) 80 or 443 lunasea://user:pass@+FireBaseDevice/
lunasea://user:pass@FireBaseUser/
lunasea://user:pass@hostname/+FireBaseDevice/
lunasea://user:pass@hostname/@FireBaseUser/
Mailgun mailgun:// (TCP) 443 mailgun://user@hostname/apikey
mailgun://user@hostname/apikey/email
mailgun://user@hostname/apikey/email1/email2/emailN
mailgun://user@hostname/apikey/?name="From%20User"
Mastodon mastodon:// or mastodons:// (TCP) 80 or 443 mastodon://access_key@hostname
mastodon://access_key@hostname/@user
mastodon://access_key@hostname/@user1/@user2/@userN
Matrix matrix:// or matrixs:// (TCP) 80 or 443 matrix://hostname
matrix://user@hostname
matrixs://user:pass@hostname:port/#room_alias
matrixs://user:pass@hostname:port/!room_id
matrixs://user:pass@hostname:port/#room_alias/!room_id/#room2
matrixs://token@hostname:port/?webhook=matrix
matrix://user:token@hostname/?webhook=slack&format=markdown
Mattermost mmost:// or mmosts:// (TCP) 8065 mmost://hostname/authkey
mmost://hostname:80/authkey
mmost://user@hostname:80/authkey
mmost://hostname/authkey?channel=channel
mmosts://hostname/authkey
mmosts://user@hostname/authkey
Microsoft Teams msteams:// (TCP) 443 msteams://TokenA/TokenB/TokenC/
Misskey misskey:// or misskeys:// (TCP) 80 or 443 misskey://access_token@hostname
MQTT mqtt:// or mqtts:// (TCP) 1883 or 8883 mqtt://hostname/topic
mqtt://user@hostname/topic
mqtts://user:pass@hostname:9883/topic
Nextcloud ncloud:// or nclouds:// (TCP) 80 or 443 ncloud://adminuser:pass@host/User
nclouds://adminuser:pass@host/User1/User2/UserN
NextcloudTalk nctalk:// or nctalks:// (TCP) 80 or 443 nctalk://user:pass@host/RoomId
nctalks://user:pass@host/RoomId1/RoomId2/RoomIdN
Notica notica:// (TCP) 443 notica://Token/
Notifiarr notifiarr:// (TCP) 443 notifiarr://apikey/#channel
notifiarr://apikey/#channel1/#channel2/#channeln
Notifico notifico:// (TCP) 443 notifico://ProjectID/MessageHook/
ntfy ntfy:// (TCP) 80 or 443 ntfy://topic/
ntfys://topic/
Office 365 o365:// (TCP) 443 o365://TenantID:AccountEmail/ClientID/ClientSecret
o365://TenantID:AccountEmail/ClientID/ClientSecret/TargetEmail
o365://TenantID:AccountEmail/ClientID/ClientSecret/TargetEmail1/TargetEmail2/TargetEmailN
OneSignal onesignal:// (TCP) 443 onesignal://AppID@APIKey/PlayerID
onesignal://TemplateID:AppID@APIKey/UserID
onesignal://AppID@APIKey/#IncludeSegment
onesignal://AppID@APIKey/Email
Opsgenie opsgenie:// (TCP) 443 opsgenie://APIKey
opsgenie://APIKey/UserID
opsgenie://APIKey/#Team
opsgenie://APIKey/*Schedule
opsgenie://APIKey/^Escalation
PagerDuty pagerduty:// (TCP) 443 pagerduty://IntegrationKey@ApiKey
pagerduty://IntegrationKey@ApiKey/Source/Component
PagerTree pagertree:// (TCP) 443 pagertree://integration_id
ParsePlatform parsep:// or parseps:// (TCP) 80 or 443 parsep://AppID:MasterKey@Hostname
parseps://AppID:MasterKey@Hostname
PopcornNotify popcorn:// (TCP) 443 popcorn://ApiKey/ToPhoneNo
popcorn://ApiKey/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
popcorn://ApiKey/ToEmail
popcorn://ApiKey/ToEmail1/ToEmail2/ToEmailN/
popcorn://ApiKey/ToPhoneNo1/ToEmail1/ToPhoneNoN/ToEmailN
Prowl prowl:// (TCP) 443 prowl://apikey
prowl://apikey/providerkey
PushBullet pbul:// (TCP) 443 pbul://accesstoken
pbul://accesstoken/#channel
pbul://accesstoken/A_DEVICE_ID
pbul://accesstoken/[email protected]
pbul://accesstoken/#channel/#channel2/[email protected]/DEVICE
Pushjet pjet:// or pjets:// (TCP) 80 or 443 pjet://hostname/secret
pjet://hostname:port/secret
pjets://secret@hostname/secret
pjets://hostname:port/secret
Push (Techulus) push:// (TCP) 443 push://apikey/
Pushed pushed:// (TCP) 443 pushed://appkey/appsecret/
pushed://appkey/appsecret/#ChannelAlias
pushed://appkey/appsecret/#ChannelAlias1/#ChannelAlias2/#ChannelAliasN
pushed://appkey/appsecret/@UserPushedID
pushed://appkey/appsecret/@UserPushedID1/@UserPushedID2/@UserPushedIDN
PushMe pushme:// (TCP) 443 pushme://Token/
Pushover pover:// (TCP) 443 pover://user@token
pover://user@token/DEVICE
pover://user@token/DEVICE1/DEVICE2/DEVICEN
Note: you must specify both your user_id and token
PushSafer psafer:// or psafers:// (TCP) 80 or 443 psafer://privatekey
psafers://privatekey/DEVICE
psafer://privatekey/DEVICE1/DEVICE2/DEVICEN
Pushy pushy:// (TCP) 443 pushy://apikey/DEVICE
pushy://apikey/DEVICE1/DEVICE2/DEVICEN
pushy://apikey/TOPIC
pushy://apikey/TOPIC1/TOPIC2/TOPICN
PushDeer pushdeer:// or pushdeers:// (TCP) 80 or 443 pushdeer://pushKey
pushdeer://hostname/pushKey
pushdeer://hostname:port/pushKey
Reddit reddit:// (TCP) 443 reddit://user:password@app_id/app_secret/subreddit
reddit://user:password@app_id/app_secret/sub1/sub2/subN
Revolt revolt:// (TCP) 443 revolt://bottoken/ChannelID
revolt://bottoken/ChannelID1/ChannelID2/ChannelIDN
Rocket.Chat rocket:// or rockets:// (TCP) 80 or 443 rocket://user:password@hostname/RoomID/Channel
rockets://user:password@hostname:443/#Channel1/#Channel1/RoomID
rocket://user:password@hostname/#Channel
rocket://webhook@hostname
rockets://webhook@hostname/@User/#Channel
RSyslog rsyslog:// (UDP) 514 rsyslog://hostname
rsyslog://hostname/Facility
Ryver ryver:// (TCP) 443 ryver://Organization/Token
ryver://botname@Organization/Token
SendGrid sendgrid:// (TCP) 443 sendgrid://APIToken:FromEmail/
sendgrid://APIToken:FromEmail/ToEmail
sendgrid://APIToken:FromEmail/ToEmail1/ToEmail2/ToEmailN/
ServerChan schan:// (TCP) 443 schan://sendkey/
Signal API signal:// or signals:// (TCP) 80 or 443 signal://hostname:port/FromPhoneNo
signal://hostname:port/FromPhoneNo/ToPhoneNo
signal://hostname:port/FromPhoneNo/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
SimplePush spush:// (TCP) 443 spush://apikey
spush://salt:password@apikey
spush://apikey?event=Apprise
Slack slack:// (TCP) 443 slack://TokenA/TokenB/TokenC/
slack://TokenA/TokenB/TokenC/Channel
slack://botname@TokenA/TokenB/TokenC/Channel
slack://user@TokenA/TokenB/TokenC/Channel1/Channel2/ChannelN
SMTP2Go smtp2go:// (TCP) 443 smtp2go://user@hostname/apikey
smtp2go://user@hostname/apikey/email
smtp2go://user@hostname/apikey/email1/email2/emailN
smtp2go://user@hostname/apikey/?name="From%20User"
SparkPost sparkpost:// (TCP) 443 sparkpost://user@hostname/apikey
sparkpost://user@hostname/apikey/email
sparkpost://user@hostname/apikey/email1/email2/emailN
sparkpost://user@hostname/apikey/?name="From%20User"
Spunk splunk:// or victorops:/ (TCP) 443 splunk://route_key@apikey
splunk://route_key@apikey/entity_id
Streamlabs strmlabs:// (TCP) 443 strmlabs://AccessToken/
strmlabs://AccessToken/?name=name&identifier=identifier&amount=0&currency=USD
Synology Chat synology:// or synologys:// (TCP) 80 or 443 synology://hostname/token
synology://hostname:port/token
Syslog syslog:// n/a syslog://
syslog://Facility
Telegram tgram:// (TCP) 443 tgram://bottoken/ChatID
tgram://bottoken/ChatID1/ChatID2/ChatIDN
Twitter twitter:// (TCP) 443 twitter://CKey/CSecret/AKey/ASecret
twitter://user@CKey/CSecret/AKey/ASecret
twitter://CKey/CSecret/AKey/ASecret/User1/User2/User2
twitter://CKey/CSecret/AKey/ASecret?mode=tweet
Twist twist:// (TCP) 443 twist://pasword:login
twist://password:login/#channel
twist://password:login/#team:channel
twist://password:login/#team:channel1/channel2/#team3:channel
XBMC xbmc:// or xbmcs:// (TCP) 8080 or 443 xbmc://hostname
xbmc://user@hostname
xbmc://user:password@hostname:port
Webex Teams (Cisco) wxteams:// (TCP) 443 wxteams://Token
WeCom Bot wecombot:// (TCP) 443 wecombot://BotKey
WhatsApp whatsapp:// (TCP) 443 whatsapp://AccessToken@FromPhoneID/ToPhoneNo
whatsapp://Template:AccessToken@FromPhoneID/ToPhoneNo
Zulip Chat zulip:// (TCP) 443 zulip://botname@Organization/Token
zulip://botname@Organization/Token/Stream
zulip://botname@Organization/Token/Email

SMS Notifications

Notification Service Service ID Default Port Example Syntax
Automated Packet Reporting System (ARPS) aprs:// (TCP) 10152 aprs://user:pass@callsign
aprs://user:pass@callsign1/callsign2/callsignN
AWS SNS sns:// (TCP) 443 sns://AccessKeyID/AccessSecretKey/RegionName/+PhoneNo
sns://AccessKeyID/AccessSecretKey/RegionName/+PhoneNo1/+PhoneNo2/+PhoneNoN
sns://AccessKeyID/AccessSecretKey/RegionName/Topic
sns://AccessKeyID/AccessSecretKey/RegionName/Topic1/Topic2/TopicN
BulkSMS bulksms:// (TCP) 443 bulksms://user:password@ToPhoneNo
bulksms://User:Password@ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
BulkVS bulkvs:// (TCP) 443 bulkvs://user:password@FromPhoneNo
bulkvs://user:password@FromPhoneNo/ToPhoneNo
bulkvs://user:password@FromPhoneNo/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
Burst SMS burstsms:// (TCP) 443 burstsms://ApiKey:ApiSecret@FromPhoneNo/ToPhoneNo
burstsms://ApiKey:ApiSecret@FromPhoneNo/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
Burst SMS burstsms:// (TCP) 443 burstsms://ApiKey:ApiSecret@FromPhoneNo/ToPhoneNo
burstsms://ApiKey:ApiSecret@FromPhoneNo/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
ClickSend clicksend:// (TCP) 443 clicksend://user:pass@PhoneNo
clicksend://user:pass@ToPhoneNo1/ToPhoneNo2/ToPhoneNoN
DAPNET dapnet:// (TCP) 80 dapnet://user:pass@callsign
dapnet://user:pass@callsign1/callsign2/callsignN
D7 Networks d7sms:// (TCP) 443 d7sms://token@PhoneNo
d7sms://token@ToPhoneNo1/ToPhoneNo2/ToPhoneNoN
DingTalk dingtalk:// (TCP) 443 dingtalk://token/
dingtalk://token/ToPhoneNo
dingtalk://token/ToPhoneNo1/ToPhoneNo2/ToPhoneNo1/
Free-Mobile freemobile:// (TCP) 443 freemobile://user@password/
httpSMS httpsms:// (TCP) 443 httpsms://ApiKey@FromPhoneNo
httpsms://ApiKey@FromPhoneNo/ToPhoneNo
httpsms://ApiKey@FromPhoneNo/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
Kavenegar kavenegar:// (TCP) 443 kavenegar://ApiKey/ToPhoneNo
kavenegar://FromPhoneNo@ApiKey/ToPhoneNo
kavenegar://ApiKey/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN
MessageBird msgbird:// (TCP) 443 msgbird://ApiKey/FromPhoneNo
msgbird://ApiKey/FromPhoneNo/ToPhoneNo
msgbird://ApiKey/FromPhoneNo/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
MSG91 msg91:// (TCP) 443 msg91://TemplateID@AuthKey/ToPhoneNo
msg91://TemplateID@AuthKey/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
Société Française du Radiotéléphone (SFR) sfr:// (TCP) 443 sfr://user:password>@spaceId/ToPhoneNo
sfr://user:password>@spaceId/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
Signal API signal:// or signals:// (TCP) 80 or 443 signal://hostname:port/FromPhoneNo
signal://hostname:port/FromPhoneNo/ToPhoneNo
signal://hostname:port/FromPhoneNo/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
Sinch sinch:// (TCP) 443 sinch://ServicePlanId:ApiToken@FromPhoneNo
sinch://ServicePlanId:ApiToken@FromPhoneNo/ToPhoneNo
sinch://ServicePlanId:ApiToken@FromPhoneNo/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
sinch://ServicePlanId:ApiToken@ShortCode/ToPhoneNo
sinch://ServicePlanId:ApiToken@ShortCode/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
SMSEagle smseagle:// or smseagles:// (TCP) 80 or 443 smseagles://hostname:port/ToPhoneNo
smseagles://hostname:port/@ToContact
smseagles://hostname:port/#ToGroup
smseagles://hostname:port/ToPhoneNo1/#ToGroup/@ToContact/
SMS Manager smsmgr:// (TCP) 443 smsmgr://ApiKey@ToPhoneNo
smsmgr://ApiKey@ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
Threema Gateway threema:// (TCP) 443 threema://GatewayID@secret/ToPhoneNo
threema://GatewayID@secret/ToEmail
threema://GatewayID@secret/ToThreemaID/
threema://GatewayID@secret/ToEmail/ToThreemaID/ToPhoneNo/...
Twilio twilio:// (TCP) 443 twilio://AccountSid:AuthToken@FromPhoneNo
twilio://AccountSid:AuthToken@FromPhoneNo/ToPhoneNo
twilio://AccountSid:AuthToken@FromPhoneNo/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
twilio://AccountSid:AuthToken@FromPhoneNo/ToPhoneNo?apikey=Key
twilio://AccountSid:AuthToken@ShortCode/ToPhoneNo
twilio://AccountSid:AuthToken@ShortCode/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
Voipms voipms:// (TCP) 443 voipms://password:email/FromPhoneNo
voipms://password:email/FromPhoneNo/ToPhoneNo
voipms://password:email/FromPhoneNo/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
Vonage (formerly Nexmo) nexmo:// (TCP) 443 nexmo://ApiKey:ApiSecret@FromPhoneNo
nexmo://ApiKey:ApiSecret@FromPhoneNo/ToPhoneNo
nexmo://ApiKey:ApiSecret@FromPhoneNo/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/

Desktop Notifications

Notification Service Service ID Default Port Example Syntax
Linux DBus Notifications dbus://
qt://
glib://
kde://
n/a dbus://
qt://
glib://
kde://
Linux Gnome Notifications gnome:// n/a gnome://
MacOS X Notifications macosx:// n/a macosx://
Windows Notifications windows:// n/a windows://

Email Notifications

Service ID Default Port Example Syntax
mailto:// (TCP) 25 mailto://userid:[email protected]
mailto://domain.com?user=userid&pass=password
mailto://domain.com:2525?user=userid&pass=password
mailto://[email protected]&pass=password
mailto://mySendingUsername:[email protected]?to=[email protected]
mailto://userid:[email protected]?smtp=mail.example.com&from=[email protected]&name=no%20reply
mailtos:// (TCP) 587 mailtos://userid:[email protected]
mailtos://domain.com?user=userid&pass=password
mailtos://domain.com:465?user=userid&pass=password
mailtos://[email protected]&pass=password
mailtos://mySendingUsername:[email protected]?to=[email protected]
mailtos://userid:[email protected]?smtp=mail.example.com&from=[email protected]&name=no%20reply

Apprise have some email services built right into it (such as yahoo, fastmail, hotmail, gmail, etc) that greatly simplify the mailto:// service. See more details here.

Custom Notifications

Post Method Service ID Default Port Example Syntax
Form form:// or forms:// (TCP) 80 or 443 form://hostname
form://user@hostname
form://user:password@hostname:port
form://hostname/a/path/to/post/to
JSON json:// or jsons:// (TCP) 80 or 443 json://hostname
json://user@hostname
json://user:password@hostname:port
json://hostname/a/path/to/post/to
XML xml:// or xmls:// (TCP) 80 or 443 xml://hostname
xml://user@hostname
xml://user:password@hostname:port
xml://hostname/a/path/to/post/to

Installation

The easiest way is to install this package is from pypi:

pip install apprise

Apprise is also packaged as an RPM and available through EPEL supporting CentOS, Redhat, Rocky, Oracle Linux, etc.

# Follow instructions on https://docs.fedoraproject.org/en-US/epel
# to get your system connected up to EPEL and then:
# Redhat/CentOS 7.x users
yum install apprise

# Redhat/CentOS 8.x+ and/or Fedora Users
dnf install apprise

You can also check out the Graphical version of Apprise to centralize your configuration and notifications through a managable webpage.

Command Line Usage

A small command line interface (CLI) tool is also provided with this package called apprise. If you know the server urls you wish to notify, you can simply provide them all on the command line and send your notifications that way:

# Send a notification to as many servers as you want
# as you can easily chain one after another (the -vv provides some
# additional verbosity to help let you know what is going on):
apprise -vv -t 'my title' -b 'my notification body' \
   'mailto://myemail:[email protected]' \
   'pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b'

# If you don't specify a --body (-b) then stdin is used allowing
# you to use the tool as part of your every day administration:
cat /proc/cpuinfo | apprise -vv -t 'cpu info' \
   'mailto://myemail:[email protected]'

# The title field is totally optional
uptime | apprise -vv \
   'discord:///4174216298/JHMHI8qBe7bk2ZwO5U711o3dV_js'

CLI Configuration Files

No one wants to put their credentials out for everyone to see on the command line. No problem apprise also supports configuration files. It can handle both a specific YAML format or a very simple TEXT format. You can also pull these configuration files via an HTTP query too! You can read more about the expected structure of the configuration files here.

# By default if no url or configuration is specified apprise will attempt to load
# configuration files (if present) from:
#  ~/.apprise
#  ~/.apprise.yaml
#  ~/.config/apprise.conf
#  ~/.config/apprise.yaml
#  /etc/apprise.conf
#  /etc/apprise.yaml

# Also a subdirectory handling allows you to leverage plugins
#  ~/.apprise/apprise
#  ~/.apprise/apprise.yaml
#  ~/.config/apprise/apprise.conf
#  ~/.config/apprise/apprise.yaml
#  /etc/apprise/apprise.yaml
#  /etc/apprise/apprise.conf

# Windows users can store their default configuration files here:
#  %APPDATA%/Apprise/apprise.conf
#  %APPDATA%/Apprise/apprise.yaml
#  %LOCALAPPDATA%/Apprise/apprise.conf
#  %LOCALAPPDATA%/Apprise/apprise.yaml
#  %ALLUSERSPROFILE%\Apprise\apprise.conf
#  %ALLUSERSPROFILE%\Apprise\apprise.yaml
#  %PROGRAMFILES%\Apprise\apprise.conf
#  %PROGRAMFILES%\Apprise\apprise.yaml
#  %COMMONPROGRAMFILES%\Apprise\apprise.conf
#  %COMMONPROGRAMFILES%\Apprise\apprise.yaml

# The configuration files specified above can also be identified with a `.yml`
# extension or even just entirely removing the `.conf` extension altogether.

# If you loaded one of those files, your command line gets really easy:
apprise -vv -t 'my title' -b 'my notification body'

# If you want to deviate from the default paths or specify more than one,
# just specify them using the --config switch:
apprise -vv -t 'my title' -b 'my notification body' \
   --config=/path/to/my/config.yml

# Got lots of configuration locations? No problem, you can specify them all:
# Apprise can even fetch the configuration from over a network!
apprise -vv -t 'my title' -b 'my notification body' \
   --config=/path/to/my/config.yml \
   --config=https://localhost/my/apprise/config

CLI File Attachments

Apprise also supports file attachments too! Specify as many attachments to a notification as you want.

# Send a funny image you found on the internet to a colleague:
apprise -vv --title 'Agile Joke' \
        --body 'Did you see this one yet?' \
        --attach https://i.redd.it/my2t4d2fx0u31.jpg \
        'mailto://myemail:[email protected]'

# Easily send an update from a critical server to your dev team
apprise -vv --title 'system crash' \
        --body 'I do not think Jim fixed the bug; see attached...' \
        --attach /var/log/myprogram.log \
        --attach /var/debug/core.2345 \
        --tag devteam

CLI Loading Custom Notifications/Hooks

To create your own custom schema:// hook so that you can trigger your own custom code, simply include the @notify decorator to wrap your function.

from apprise.decorators import notify
#
# The below assumes you want to catch foobar:// calls:
#
@notify(on="foobar", name="My Custom Foobar Plugin")
def my_custom_notification_wrapper(body, title, notify_type, *args, **kwargs):
    """My custom notification function that triggers on all foobar:// calls
    """
    # Write all of your code here... as an example...
    print("{}: {} - {}".format(notify_type.upper(), title, body))

    # Returning True/False is a way to relay your status back to Apprise.
    # Returning nothing (None by default) is always interpreted as a Success

Once you've defined your custom hook, you just need to tell Apprise where it is at runtime.

# By default if no plugin path is specified apprise will attempt to load
# all plugin files (if present) from the following directory paths:
#  ~/.apprise/plugins
#  ~/.config/apprise/plugins
#  /var/lib/apprise/plugins

# Windows users can store their default plugin files in these directories:
#  %APPDATA%/Apprise/plugins
#  %LOCALAPPDATA%/Apprise/plugins
#  %ALLUSERSPROFILE%\Apprise\plugins
#  %PROGRAMFILES%\Apprise\plugins
#  %COMMONPROGRAMFILES%\Apprise\plugins

# If you placed your plugin file within one of the directories already defined
# above, then your call simply needs to look like:
apprise -vv --title 'custom override' \
        --body 'the body of my message' \
        foobar:\\

# However you can over-ride the path like so
apprise -vv --title 'custom override' \
        --body 'the body of my message' \
        --plugin-path /path/to/my/plugin.py \
        foobar:\\

You can read more about creating your own custom notifications and/or hooks here.

Developer API Usage

To send a notification from within your python application, just do the following:

import apprise

# Create an Apprise instance
apobj = apprise.Apprise()

# Add all of the notification services by their server url.
# A sample email notification:
apobj.add('mailto://myuserid:[email protected]')

# A sample pushbullet notification
apobj.add('pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b')

# Then notify these services any time you desire. The below would
# notify all of the services loaded into our Apprise object.
apobj.notify(
    body='what a great notification service!',
    title='my notification title',
)

API Configuration Files

Developers need access to configuration files too. The good news is their use just involves declaring another object (called AppriseConfig) that the Apprise object can ingest. You can also freely mix and match config and notification entries as often as you wish! You can read more about the expected structure of the configuration files here.

import apprise

# Create an Apprise instance
apobj = apprise.Apprise()

# Create an Config instance
config = apprise.AppriseConfig()

# Add a configuration source:
config.add('/path/to/my/config.yml')

# Add another...
config.add('https://myserver:8080/path/to/config')

# Make sure to add our config into our apprise object
apobj.add(config)

# You can mix and match; add an entry directly if you want too
# In this entry we associate the 'admin' tag with our notification
apobj.add('mailto://myuser:[email protected]', tag='admin')

# Then notify these services any time you desire. The below would
# notify all of the services that have not been bound to any specific
# tag.
apobj.notify(
    body='what a great notification service!',
    title='my notification title',
)

# Tagging allows you to specifically target only specific notification
# services you've loaded:
apobj.notify(
    body='send a notification to our admin group',
    title='Attention Admins',
    # notify any services tagged with the 'admin' tag
    tag='admin',
)

# If you want to notify absolutely everything (regardless of whether
# it's been tagged or not), just use the reserved tag of 'all':
apobj.notify(
    body='send a notification to our admin group',
    title='Attention Admins',
    # notify absolutely everything loaded, regardless on wether
    # it has a tag associated with it or not:
    tag='all',
)

API File Attachments

Attachments are very easy to send using the Apprise API:

import apprise

# Create an Apprise instance
apobj = apprise.Apprise()

# Add at least one service you want to notify
apobj.add('mailto://myuser:[email protected]')

# Then send your attachment.
apobj.notify(
    title='A great photo of our family',
    body='The flash caused Jane to close her eyes! hah! :)',
    attach='/local/path/to/my/DSC_003.jpg',
)

# Send a web based attachment too! In the below example, we connect to a home
# security camera and send a live image to an email. By default remote web
# content is cached, but for a security camera we might want to call notify
# again later in our code, so we want our last image retrieved to expire(in
# this case after 3 seconds).
apobj.notify(
    title='Latest security image',
    attach='http://admin:password@hikvision-cam01/ISAPI/Streaming/channels/101/picture?cache=3'
)

To send more than one attachment, just use a list, set, or tuple instead:

import apprise

# Create an Apprise instance
apobj = apprise.Apprise()

# Add at least one service you want to notify
apobj.add('mailto://myuser:[email protected]')

# Now add all of the entries we're interested in:
attach = (
    # ?name= allows us to rename the actual jpeg as found on the site
    # to be another name when sent to our receipient(s)
    'https://i.redd.it/my2t4d2fx0u31.jpg?name=FlyingToMars.jpg',

    # Now add another:
    '/path/to/funny/joke.gif',
)

# Send your multiple attachments with a single notify call:
apobj.notify(
    title='Some good jokes.',
    body='Hey guys, check out these!',
    attach=attach,
)

API Loading Custom Notifications/Hooks

By default, no custom plugins are loaded at all for those building from within the Apprise API. It's at the developers discretion to load custom modules. But should you choose to do so, it's as easy as including the path reference in the AppriseAsset() object prior to the initialization of your Apprise() instance.

For example:

from apprise import Apprise
from apprise import AppriseAsset

# Prepare your Asset object so that you can enable the custom plugins to
# be loaded for your instance of Apprise...
asset = AppriseAsset(plugin_paths="/path/to/scan")

# OR You can also generate scan more then one file too:
asset = AppriseAsset(
    plugin_paths=[
        # Iterate over all python libraries found in the root of the
        # specified path. This is NOT a recursive (directory) scan; only
        # the first level is parsed. HOWEVER, if a directory containing
        # an __init__.py is found, it will be included in the load.
        "/dir/containing/many/python/libraries",

        # An absolute path to a plugin.py to exclusively load
        "/path/to/plugin.py",

        # if you point to a directory that has an __init__.py file found in
        # it, then only that file is loaded (it's similar to point to a
        # absolute .py file. Hence, there is no (level 1) scanning at all
        # within the directory specified.
        "/path/to/dir/library"
    ]
)

# Now that we've got our asset, we just work with our Apprise object as we
# normally do
aobj = Apprise(asset=asset)

# If our new custom `foobar://` library was loaded (presuming we prepared
# one like in the examples above).  then you would be able to safely add it
# into Apprise at this point
aobj.add('foobar://')

# Send our notification out through our foobar://
aobj.notify("test")

You can read more about creating your own custom notifications and/or hooks here.

Want To Learn More?

If you're interested in reading more about this and other methods on how to customize your own notifications, please check out the following links:

Want to help make Apprise better?

apprise's People

Contributors

amotl avatar caronc avatar cclauss avatar cdkl avatar circa10a avatar fusionx9000 avatar geeseven avatar hagemt avatar isometimescode avatar joergschultzelutter avatar kentonparton avatar kevinlauer avatar kooltux avatar kphatak avatar linkmauve avatar peterdavehello avatar phea avatar quarky9 avatar raman325 avatar remirigal avatar samueltardieu avatar scop avatar sebthom avatar sentriz avatar spasche avatar spyoungtech avatar stimeke avatar wfdewith avatar xuzheliang135 avatar yoryan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apprise's Issues

Gotify support

Gotify is picking up the Pushjet torch for self-hosted notifications for Android. Seems like Gotify would be a good addition for apprise. Like Pushjet, there is a self-hosted server component and an Android application. The API looks straight forward.

I might take a stab at a pull request.

Apprise CLI does not detect and/or source default configuration files

I am trying to use apprise on a Raspberry Pi to send notices to my Macbook. I get the following response:

apprise --verbose --body "Test message" growl://[email protected] 
Invalid response: ('400', 'There was an error parsing the key for validity')
2019-04-10 03:26:59,685 - WARNING - A Connection error occured sending Growl notification to 192.168.2.117.

Looking at the Growl Preferences under the IP for the Pi I do see Apprise listed as an application and it is enabled with default settings. The Growl version is 2.1.3. Apprise is just installed for python3 at v0.7.5

I am able to send to this system from another Mac using growlnotify.

Any assistance would be appreciated.

One other anomaly: it doesn't seem to recognize either ~/.config/apprise or ~/.apprise as the config files. I have a single line in those files consisting of the URL shown above.

[ Dummy Ticket ] - Apprise Wiki Images

Dummy Ticket - Apprise Wiki Image Store

GitHub doesn't allow you to upload static images to it's wiki pages. It does however allow you to upload them to Issues (like this one).

This is a dummy ticket that can be ignored and will remain closed. It's use is just to host images intended to be displayed on the Apprise wiki page.

Error when sending email notifications via SES

(Note: I'm not using Apprise directly but via Ouroboros. It didn't feel right to open a bug there so I've opened it here)

When email notifications are configured to use SES an error is thrown that prevents messages from being sent:

2019-01-30 13:25:54 : DEBUG : NotifyEmail : Securing connection with TLS...
2019-01-30 13:25:54 : DEBUG : NotifyEmail : Applying user credentials...
2019-01-30 13:25:55 : WARNING : NotifyEmail : A Connection error occured sending Email notification to email-smtp.us-east-1.amazonaws.com.
2019-01-30 13:25:55 : DEBUG : NotifyEmail : Socket Exception: (554, b"Transaction failed: Duplicate header 'Content-Type'.")

This may have been fixed by #33 but since I'm not using Apprise directly I haven't had a chance to confirm it.

Adding Plex and Emby support?

First, I would like to thank you for wrapping up all those notification systems in one single and easy to use module.

I'm currently integrating it in Bazarr and I was wondering if you would like to add support for Plex and Emby?

Thanks again and keep up the good work! :-)

[Feature Request] Notification Pools/Individual Server Notifications

I think the only way that MARKDOWN/HTML can even be a standard would be to be able to either create "notification pools" and/or being able to send to individual "servers" because too many endpoints do not support their syntax. In addition, being able to call apobj.servers[0].notify() and

apobj.pool.create('pool1')
apobj.pool.add('pool1', notifier_string)
apobj.notify(pool='pool1', *args)

would be super awesome

Add Markdown Support for Telegram

Doesn't really matter whether one sends inline-codeblocks or multiline codeblocks.
They are being ignored and displayed as is on the telegram side.

echo "\`code inline\`" | apprise -t 'T E S T !' "tgram://<mytoken>/<mychat>"

results in

(meanwhile on discord:)

Cisco Webex Teams and Meetings Support

It would also be good to add cisco webex support.

https://apphub.webex.com/integrations/incoming-webhooks-cisco-systems

https://developer.webex.com/docs/api/basics

Below copied from webhooks page from Cisco.


Send messages to Cisco Webex Teams from other services.
Incoming webhooks let you post messages in Webex Teams spaces when an event occurs in another service that supports webhooks. Webhook events trigger in near real-time allowing your Webex Teams spaces to stay in sync with events happening outside of Webex Teams.

To use incoming webhooks, simply connect this integration to your Webex Teams account, create a new webhook below, and configure your service to post messages to the provided URL. The incoming webhook URL expects an HTTP request with a JSON payload which includes the message in either a plaintext field or Markdown-formatted field.

To send a plaintext message, make an HTTP POST to the URL and provide the message body in the text field of the request:

curl -X POST -H "Content-Type: application/json" ∖
-d '{"text" : "This is a message from a Cisco Webex Teams incoming webhook."}' ∖ 
https://api.ciscospark.com/v1/webhooks/incoming/<incoming_webhook_url>"

To send a formatted message, make an HTTP POST to the URL and provide the message body (in Markdown format) in the markdown field:

curl -X POST -H "Content-Type: application/json" ∖
-d '{"markdown" : "This is a formatted message from a Cisco Webex Teams incoming webhook."}' ∖
 "https://api.ciscospark.com/v1/webhooks/incoming/<incoming_webhook_url>".

See our Webex Teams for Developer documentation about formatting messages for more examples of how you can create richly-formatted messages in Webex Teams.

Add Matrix.org support

I'm currently moving some WebHooks from Slack to a self hosted Matrix instance using a WebHook bridge. This works pretty well so far, but it requires being able to configure the complete URL of the WebHook endpoint and that's currently not possible in apprise.

Would it be possible to either add an extra option in the Slack notification service to specify a URL, or to create an extra WebHook notification service?

PyPi Display not applying Markdown for Apprise

Visit PyPI/apprise and see what an ugly display you get.

Based on documentation, the setup.py just needs the extra line: long_description_content_type='text/markdown'.

But I don't think this is the case since the 0.7.0 release I just pushed looks awful. I'm missing something obvious here.

Fastmail Support added to Email Notifications

hello. I am using fastmail with a custom domain.

from their docs:
https://www.fastmail.com/help/technical/servernamesandports.html
(under smtp) "Username | Your FastMail email address, including the domain".

and from your docs:
"Some mail servers will require your {userid} to be your full email address. In these cases, you'll need to specify your username in the url as an attribute like so"

so i think I have that correct. here is what i have so far:
mailtos://[email protected]:465?smtp=smtp.fastmail.com&pass=myapppassword&[email protected]

here is what this line is generating:

('user', '[email protected]')
('password', 'myappassword')
('port', 465)
('host', 'mydomain.com')
('fullpath', None)
('path', None)
('query', None)
('schema', 'mailtos')
('url', 'mailtos://[email protected]:465')
('qsd', {'smtp': 'smtp.fastmail.com', 'pass': 'myappassword', 'user': '[email protected]'})
('secure', True)
('verify', True)
('notify_format', 'html')
('to', '[email protected]')
('from', '[email protected]')
('smtp_host', 'smtp.fastmail.com')

if you know what is happening I would appreciate it a lot. (I like this project)

thank you
Senan

Undefined name 'gntp' in config.py

Related to absolute import?

flake8 testing of https://github.com/caronc/apprise on Python 3.7.1

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./apprise/plugins/NotifyGrowl/gntp/config.py:24:21: F821 undefined name 'gntp'
class GrowlNotifier(gntp.notifier.GrowlNotifier):
                    ^
./apprise/plugins/NotifyGrowl/gntp/config.py:39:12: F821 undefined name 'gntp'
		config = gntp.shim.RawConfigParser({
           ^
./apprise/plugins/NotifyGrowl/gntp/config.py:70:2: F821 undefined name 'gntp'
	gntp.notifier.mini(description, **kwargs)
 ^
3     F821 undefined name 'gntp'
3

E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely "style violations" -- useful for readability but they do not effect runtime safety.

  • F821: undefined name name
  • F822: undefined name name in __all__
  • F823: local variable name referenced before assignment
  • E901: SyntaxError or IndentationError
  • E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree

How does it relate to the "notifiers" Python library?

Hi.

That's a very nice library that you made here, congrats! 👍

I don't know if you are aware of the notifiers library which seems very similar to apprise as it provides a convenient API to send notifications to several providers.

I was wondering: is there any fundamental difference between these two libraries?

Read Notification URLs from predefined YAML file(s) and/or URL(s)

One would simply utilize the file://, http:// and/or https:// URLs as part of their apprise syntax; however their meaning would be interpreted as read to fetch the notifications to load.

The idea is you lock all of your tokens, passwords and usernames in a yaml file that has permissions that only you can access. It's better than passing this information on the command line.

Here would be an example:

# Open up apprise.yaml and read in the notification URLs
# From there construct all of the notifications to alert:
apprise -b "test body" -t "test title" \
    file:///path/to/yaml/config/file/apprise.yaml

http:// and https:// would work the same as file:// except they'd go to the URL you specify and hope to find a YAML file to read. Ideally you should be passing back the correct mime type for this such as one of the following:

text/yaml
text/x-yaml
application/yaml
application/x-yaml

The most minimal apprise syntax would be as follows:

# A version would be important so that I can anticipate future changes and/or
# ideas if this value is left out, then 'version: 1' would be implied. 
version: 1

# Now the meat and potatos: simply define your notification urls:
urls:
  - pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b
  - mailto://test:[email protected]

To take this feature a step further, the URL should be allowed to be constructed through options. This allows for an easier read (and doesn't require you to escape special characters such as slashes (/) or ampersands (&) since they otherwise conflict with the URL.

# our version definition
version: 1

urls:
  - pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b

    # adding a colon to the end of our URL now makes it something we can apply
    # additional configuration to (thanks to YAML).
  - mailto://test:[email protected]:

    # associate our mailto object with the tag profile_changes. Without this entry,
    # the profile gets added automatically to the 'default' tag. This will be important
    # when https://github.com/caronc/apprise/issues/34 gets implemented.
    # Right now it's just on standby (and ready to be supported). :)
    tags:
      - profile_changes

    # These over-ride anything otherwise defined in the URL string.
    args:
      # optional over-rides
      - user: caronc
      - password: /234j3jkada52:3&
      - smtp_server: example.com

If we allow all of this, then we might as well additionally support the override of the apprise asset object too. So if we take this configuration one step further:

# our version definition
version: 1

# allow one to over-ride the asset object too
asset:
  # optional asset over-ride
  app_id: MyApp
  app_desc: MyApp Description
  app_url: https://my/apps/website/
  theme: default
  default_extension: .png
  image_path_mask: /optional/path/to/{THEME}/apprise-{TYPE}-{XY}{EXTENSION}
  image_url_mask: https://my/path/to/{THEME}/apprise-{TYPE}-{XY}{EXTENSION}

# You've seen the below already; but lets just stick it in to show a complete
# configuration file:
urls:
  - pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b
  - mailto://test:[email protected]:
    # associate with tags. Without this entry, the
    # profile gets added automatically to the 'default'
    # tag.
    tags:
      - profile_changes

    args:
      # optional over-rides
      - smtp_server: example.com

Improve Unicode Support

Here is the original traceback source before it was tidied up below:

Traceback (most recent call last):
...
File "apprise\Apprise.py", line 248, in notify
File "path\to\markdown\__init__.py", line 470, in markdown
File "path\to\markdown\__init__.py", line 338, in convert
UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 3078: ordinal not in range(128). -- Note: Markdown only accepts unicode input!

Apprise should operate similar to markdown and convert everything to unicode prior to working with the string. This will fix compatibility with markdown and fix any other compatibility issues down the road as well.

Suggestions

Looking good.

Suggestions...

Rename folder /apprise/var to /assets
Make dir /assets/images/
Move images into /assets/images/
Rename /bin to something else (perhaps app) given that the .py file in there is text, not binary.

That way, core /apprise/* contains purely required files for function that can be easily copied/upgraded into some project, where the assets folder is by default linked in via a class file that can be overridden by some project tailored assets without the need to include unnecessary default assets.

As an idea, for example

from apprise import assets

class SomeProjectAssets(AppriseAssets):
   self.image1 = /path/to/someproject/image
   self.image2 = /path/to/someproject/image2

The goal here is to maintain core apprise folder pure so that a copy of that folder into some project is as clean as possible without superfluous files.

Good luck with this, I'm sure many will come to use it.

Kodi not working

Notifications are not working on Kodi 17 (Krypton). Here is the command and error message:

apprise -t 'my title' -b 'my notification body' 'kodi://user:pass@kodi:8080'
17:15:14.490 T:2424492960   ERROR: JSONRPC: Failed to parse '{"id":1,"image":"http://nuxref.com/apprise/themes/default/apprise-info-128x128.png","jsonrpc":"6.0","method":"GUI.ShowNotification","params":{"displaytime":12000,"message":"my notification body","title":"my title"},"type":"info"}'

Changing jsonrpc from 6.0 to 2.0 seems to do the trick. I am not sure if this would break older and EOL versions of Kodi. Is backward compatibility important? The kodi team does not plan another 17 release and 18 (Leia) alpha 1 was released in March.

Also FYI, the apprise image is not being displayed in the notification, but the theme info icon is. I am not sure if this is due to Kodi's themes I tested, including the default. Personally, I prefer the icon over the image.

Send an email from the configured server to another address

Currently a configuration such as mailto://user:[email protected] would fire an email to [email protected].

This ticket is to have the ability to send an email to a different email address using the credentials provided to another. Hence: mailto://user:[email protected][email protected] should send an email to [email protected] using the user's email credentials (in this example it would be send from their [email protected] email account)..

Discord parser behaves weirdly on strings that begin with "Input #"

echo 'Input #0,string string string \nsometext \nsomemoretext \nmoretext \nwaymoretext\nInput #1 \nanothertext' | apprise -t 'T E S T !' "discord://<name>@<hookID>/<token>/?avatar=off&thumbnail=off"

results in the following... it appears like it parses from one Input to another. E.g. "somemoretext" and "moretext" and "wamoretext" are all being discarded.

Python v3.7 support

Testing on Debian (9) went well. tested both command line and Python library code with an email notice and an IFTTT notice. Well done!

Installed Python 3.7.0 and apprise on Windows 10. Ran 2 commands that successfully executed on Debian. Both get the same error:

C:\Users\xxxxx>apprise -vvv -t "Title 10" -b "Body 10" 'ifttt:///<key>@AppriseNotice'
Traceback (most recent call last):
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python37\Scripts\apprise.exe\__main__.py", line 5, in <module>
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\site-packages\apprise\__init__.py", line 31, in <module>
    from .plugins.NotifyBase import NotifyBase
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\site-packages\apprise\plugins\__init__.py", line 43, in <module>
    from .NotifyTwitter.NotifyTwitter import NotifyTwitter
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\site-packages\apprise\plugins\NotifyTwitter\__init__.py", line 17, in <module>
    from . import NotifyTwitter
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\site-packages\apprise\plugins\NotifyTwitter\NotifyTwitter.py", line 19, in <module>
    from . import tweepy
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\site-packages\apprise\plugins\NotifyTwitter\tweepy\__init__.py", line 17, in <module>
    from .streaming import Stream, StreamListener
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\site-packages\apprise\plugins\NotifyTwitter\tweepy\streaming.py", line 355
    def _start(self, async):
                         ^
SyntaxError: invalid syntax
C:\Users\xxxxx>apprise -vvv -t "Title 1" -b "Body 1" 'mailto://xxxxx:[email protected]'
Traceback (most recent call last):
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python37\Scripts\apprise.exe\__main__.py", line 5, in <module>
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\site-packages\apprise\__init__.py", line 31, in <module>
    from .plugins.NotifyBase import NotifyBase
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\site-packages\apprise\plugins\__init__.py", line 43, in <module>
    from .NotifyTwitter.NotifyTwitter import NotifyTwitter
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\site-packages\apprise\plugins\NotifyTwitter\__init__.py", line 17, in <module>
    from . import NotifyTwitter
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\site-packages\apprise\plugins\NotifyTwitter\NotifyTwitter.py", line 19, in <module>
    from . import tweepy
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\site-packages\apprise\plugins\NotifyTwitter\tweepy\__init__.py", line 17, in <module>
    from .streaming import Stream, StreamListener
  File "c:\users\xxxxx\appdata\local\programs\python\python37\lib\site-packages\apprise\plugins\NotifyTwitter\tweepy\streaming.py", line 355
    def _start(self, async):
                         ^
SyntaxError: invalid syntax

Config error, code bug, or user stupidity?

Add Pushed Notification Support

Add Pushed Notification support

At the very minimum, a user would be required to create an Pushed App which would keep the URL simple (just requiring an AppKey and AppSecret). Should they expand on this, the notification should support mix and matches of both Channel and Users as long as their Aliases and PushIDs are known.

Syntax would probably be in the format of:

  • pushed://AppKey/AppSecret/
  • pushed://AppKey/AppSecret/#ChannelAlias
  • pushed://AppKey/AppSecret/#ChannelAlias1/#ChannelAlias2/#ChannelAliasN
  • pushed://AppKey/AppSecret/@UserPushedID
  • pushed://AppKey/AppSecret/@UserPushedID1/@UserPushedID2/@UserPushedIDN

Mix and match too:

  • pushed://AppKey/AppSecret/@UserPushedID1/#ChannelAlias/

Apprise documentation set up here

Discord agent forces Webhook Icon

It seems that Apprise is always sending the logo for Apprise with Discord content, which prevents the user from specifying a custom one on the webhook definition itself.

If the software using Apprise hasn't forced the logo using the avatar variable, it shouldn't be sending one at all (allowing the default from the Webhook to take over).

ValueError: Namespace on headless server

Hi,

Great work !

Got an issue on 0.7.3 with an headless server:

Traceback (most recent call last):
  File "/usr/local/bin/apprise", line 6, in <module>
    from apprise.cli import main
  File "/usr/local/lib/python3.6/dist-packages/apprise/__init__.py", line 40, in <module> 
    from .plugins.NotifyBase import NotifyBase
  File "/usr/local/lib/python3.6/dist-packages/apprise/plugins/__init__.py", line 31, in <module>
    from .NotifyDBus import NotifyDBus
  File "/usr/local/lib/python3.6/dist-packages/apprise/plugins/NotifyDBus.py", line 86, in <module>
    gi.require_version('GdkPixbuf', '2.0')
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 130, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace GdkPixbuf not available

It happens that I have the gi library installed. But not all other GTK libraries needed by the Dbus and Gnome plugins. Seems that code should also except ValueError or some other workaround for headless servers.

KDE / Gnome notifications

The PC Desktop notifications feature is excellent, however only MS Windows is currently supported. This RFE requests that Gnome and KDE support be added as well.

Rocket notify channel match regex

Rocket Chat can have dashes and/or underscores in channel names. I believe the regex won't currently match this.

Also, Rocket Chat now has webhooks so no username/password required. May want to update that, but that's a separate issue.

Matrix Notification Refactored to Support Core API and Webhook API

[I hope that it's ok to open this kind of howto question as issue -- please let me know if there is a more suitable platform]

Hi there,

I am attempting to get Apprise Matrix notifications working (to my own Matrix server based on Synapse), but am somewhat lost how to obtain the token that's part of the notification URI. Any pointers are much appreciated!

Thanks,
Thilo

Eliminate Notify My Android (NMA) as service is no longer available anymore.

With respect to this pull request, this is to perform the same action upstream. This involves an updated domain reference (https://www.notifymyandroid.com) to a new value : https://notifymyandroid.appspot.com.

  • Source of an announced change announced here on Twitter which deprecates another older URL (not the one we currently have).
  • Reference to their API still documents under the current URL already in place.

TODO: Investigate further to determine if the API change is even nessisary

YAML Warning

Trying to use a YAML configuration file for the first time and when executing the python3 script I call it in I am getting this error and notifications are sent.

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/apprise/config/ConfigBase.py:313: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
result = yaml.load(content)

Mailgun E-Mail notification URL

Hi,

I could use some help with my apprise E-Mail notification URL for the E-Mail service provider mailgun.

I followed the configuration instructions https://github.com/caronc/apprise/wiki/Notify_email and troubleshooting instructions https://github.com/caronc/apprise/wiki/Troubleshooting but unfortunately couldn't nail down the misconfiguration.

Following command was used for testing: apprise -vvv -t "apprise test title" -b "apprise test body" mailtos://SMTP_PASSWORD@MY_DOMAIN?smtp=SMTP_SERVER&from=MY_NAME@MY_DOMAIN&name=NAME&to=ANOTHER_NAME@ANOTHER_DOMAIN&user=SMTP_USER.

The SMTP_USER has to be specified as a full E-Mail address. Furthermore MY_DOMAIN, SMTP_SERVER and ANOTHER_DOMAIN have different domains. Please note that the mailgun configuration is correct, i.e. manually sending E-Mails with those parameters is working as expected.

After issuing the test command, the SMTP server receives following message header:
to: "PASSWORD@MY_DOMAIN"
from: "Apprise Notifications <PASSWORD@MY_DOMAIN>"
subject: "apprise test title"

I would expect the following message header:
to: "ANOTHER_NAME@ANOTHER_DOMAIN"
from: "NAME <MY_NAME@MY_DOMAIN>"
subject: "apprise test title"

What am I missing here?

EDIT: I've added additional verbose parameters which results in the log below. Clearly the parameters specified above are not populated correctly. I guess I have a misunderstanding of those parameters described in https://github.com/caronc/apprise/wiki/Notify_email. How does the notification URL need to look like in my case?

# apprise -vvvvvvvvvv -t "apprise test title" -b "apprise test body" mailtos://SMTP_PASSWORD@MY_DOMAIN?smtp=SMTP_SERVER&from=MY_EMAIL@MY_DOMAIN&name=NAME&to=ANOTHER_EMAIL@ANOTHER_DOMAIN&user=SMTP_USER
[2]   Done                       apprise -vvvvvvvvvv -t "apprise test title" -b "apprise test body" mailtos://SMTP_PASSWORD@MY_DOMAIN?smtp=SMTP_SERVER&from=MY_EMAIL@MY_DOMAIN&name=NAME&to=ANOTHER_EMAIL@ANOTHER_DOMAIN&user=SMTP_USER
# 2019-04-25 18:24:53,813 - TRACE - URL mailtos://SMTP_PASSWORD@MY_DOMAIN?smtp=SMTP_SERVER unpacked as:
user="SMTP_PASSWORD"
password="None"
port="None"
host="MY_DOMAIN"
fullpath="None"
path="None"
query="None"
schema="mailtos"
url="mailtos://SMTP_PASSWORD@MY_DOMAIN"
qsd="{'smtp': 'SMTP_SERVER'}"
qsd+="{}"
qsd-="{}"
secure="True"
verify="True"
to="SMTP_PASSWORD@MY_DOMAIN"
from="SMTP_PASSWORD@MY_DOMAIN"
smtp_host="SMTP_SERVER"
tag="set()"
2019-04-25 18:24:53,814 - DEBUG - Loaded URL: mailtos://SMTP_PASSWORD@MY_DOMAIN/?format=html&overflow=upstream&to=SMTP_PASSWORD%40MY_DOMAIN&from=SMTP_PASSWORD%40MY_DOMAIN&mode=starttls&smtp=SMTP_SERVER&timeout=15&user=SMTP_PASSWORD&verify=yes
2019-04-25 18:24:53,814 - DEBUG - Email From: SMTP_PASSWORD@MY_DOMAIN <Apprise Notifications>
2019-04-25 18:24:53,814 - DEBUG - Email To: SMTP_PASSWORD@MY_DOMAIN
2019-04-25 18:24:53,814 - DEBUG - Login ID: SMTP_PASSWORD
2019-04-25 18:24:53,815 - DEBUG - Delivery: SMTP_SERVER:587
2019-04-25 18:24:53,815 - DEBUG - Connecting to remote SMTP server...
2019-04-25 18:24:53,872 - DEBUG - Securing connection with STARTTLS...
2019-04-25 18:24:54,117 - INFO - Sent Email notification to "SMTP_PASSWORD@MY_DOMAIN".

XMPP Notification Support

A request was made (Reference) inquiring on XMPP support.

The URL syntax might look as follows:

  • unsecure: xmpp://user:password@serverhost:port/
  • secure: xmpps://user:password@serverhost:port/

According to Wikipedia, the default port if none is specified should be 5222 where as the SSL version (xmpps://) would be 5223.

Notes:

  • A good reference library might be xmpp, but it hasn't been maintained for 9 years.
  • The user who made the request also provided an example wrapper written in GO (xmppsend) that performs the similar task.

Trouble executing apprise test program

Debian 9 - clean install
Installed as per readme.md
Found apprise program in ~/.local/bin/apprise (not in $PATH)
Tried to execute mailto notice (non-root user):

./.local/bin/apprise -t "This is the Title" -b "This is the body" 'mailtos://XXXXX:[email protected]'

Got error message:

ERROR:root:notification exception
Traceback (most recent call last):
  File "/home/xxxx/.local/lib/python3.5/site-packages/apprise/Apprise.py", line 259, in notify
    notify_type=notify_type):
  File "/home/xxxx/.local/lib/python3.5/site-packages/apprise/plugins/NotifyEmail.py", line 292, in notify
    socket.quit()
UnboundLocalError: local variable 'socket' referenced before assignment

Tried again as root (sudo):

sudo ./.local/bin/apprise -t "This is the Title" -b "This is the body" 'mailtos://XXXXX:[email protected]'

Got a different error message:

Traceback (most recent call last):
  File "./.local/bin/apprise", line 7, in <module>
    from apprise.cli import main
ImportError: No module named 'apprise'

Clearly I'm not configured properly. Any ideas?

Include schema details in Apprise.details() function

A request made in #55 was to enhance the details() function to additionally include the information needed generate an Apprise URL by knowing what attributes to ask for.

Attributes will have to address the following:

  • Is this a privacy related item (like a token, or a password)
  • can this attribute be represented as an array
  • does this attribute require a prefix or suffix associated with it. For example, in some supported notifications, ambiguity between a user and a channel is identified by simply placing a @ or # in-front of the token (as part of it's assembly).
  • can only be one (or many) of X possible values; this value list must be available.

The other hairy thing to consider is that some URLs have some hacky logic behind the scenes to make it really easy for a user to input the data, but make it difficult to reverse engineer separate fields back into the URL (Telegram example).

I propose that if the details() function is to provide the possible tokens/url syntax, then the function that re-assembles them back together (knowing the tokens) should come from apprise too.

Consider the API changes:

{
    "version": "0.5.2",
    ...
    "schemas": [
    {
        "service_name": "Growl",
        "setup_url": "https://github.com/caronc/apprise/wiki/Notify_growl",
        "service_url": "http://growl.info/",
        "protocols": [
            "growl"
        ],

        # New - identify each token and some details around it
        #       that developers could use to dynamically build
        #       urls with:
        #
        "tokens": {
           "protocol": {
              "required": True,
              "private": False,
              "multi": {
                  fixed_values: [ "growl" ],
              },
            },
           "hostname": {
              "required": True,
              "private": False,
              "multi": None,
            },
           "port": {
              "required": False,
              "private": False,
              "multi": None,
            },
           "password": {
              "required": False,
              "private": True,
              "multi": None,
            }
        }
    },

This should be enough details for developers to dynamically build websites, or input fields and/or options.

From there, the construction of the URL should be as simple as:

   import apprise
   # You only need to provide the options that are required.  It can be assumed that
   # the protocol entry is the bare minimum to this:
   options = {
      # required entries
      "protocol": "growl",
      "hostname": "localhost",
      
      # Optional configuration"
      "password: "mypass"
   }
   print(apprise.Apprise.build_url(**options})
   # provided that the minimum required entries are met, you should always receive a
   # string response here.  In the above case:
   #           growl://mypass@localhost

This would require each notification which currently must provide a static parse_url() function the hood would also provide a build_url() function as well that the apprise class could handle figuring out based on the options it was provided.

Auto-build URL based on webhook

A lot of notification services provide the end user with webhook URLs. It's up to the user to interpret these and manipulate the URL so that it works with Apprise.

For instance, Slack provides a webhook URL that looks like this:
https://hooks.slack.com/services/T1JJ3T3L2/A1BRTD4JD/TIiajkdnlazkcOXrIdevi7F

However Apprise (as is) can't interpret this by itself; this Issue is to request that it is however supported. This URL above can be easily (and automatically) swapped to be what Apprise expected it to be:
slack://T1JJ3T3L2/A1BRTD4JD/TIiajkdnlazkcOXrIdevi7F

This would make for a much easier experience to those wishing to just copy and paste the provided URLs they're given from the notification sources. This applies to Slack, Discord, Telegram, etc.

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.