A Python library to send notifications to your iPhone, Discord, Telegram, WeChat, QQ and DingTalk.
Bark, Discord, Telegram, ServerChan, ServerChanTurbo, WechatWorkApp, WechatWorkBot, pushplus, go-cqhttp, Qmsg, DingTalk, Lark, SMTP, Customised providers
Via pip:
pip install onepush
Or via source code:
git clone https://github.com/y1ndan/onepush.git
cd onepush
python setup.py install
from onepush import get_notifier
n = get_notifier('bark')
print(n.params)
response = n.notify(key='YOUR_BARK_KEY', title='OnePush', content='Hello World!')
print(response.text)
# {'required': ['key'], 'optional': ['title', 'content', 'sound', 'isarchive', 'icon', 'group', 'url', 'copy', 'autocopy']}
# {"code":200,"message":"success","timestamp":1633528319}Or:
from onepush import notify
notify('bark', key='YOUR_BARK_KEY', title='OnePush', content='Hello World!')You can use proxy with any notifier by adding the proxies parameter:
# Using HTTP/HTTPS proxy
proxies = {
'http': 'http://127.0.0.1:7890',
'https': 'socks5h://127.0.0.1:7890'
}
notify('bark',
key='YOUR_BARK_KEY',
title='OnePush',
content='Hello World!',
proxies=proxies)The proxies parameter accepts the same format as the requests library.