Skip to main content

A Python library to send notifications to your iPhone, Discord, Telegram, WeChat, QQ and DingTalk.

Project description

onepush

A Python library to send notifications to your iPhone, Discord, Telegram, WeChat, QQ and DingTalk.

Supported providers

Bark, Discord, Telegram, ServerChan, ServerChanTurbo, WechatWorkApp, WechatWorkBot, pushplus, go-cqhttp, Qmsg, DingTalk, Lark, SMTP, Customised providers

Installation

Via pip:

pip install onepush

Or via source code:

git clone https://github.com/y1ndan/onepush.git
cd onepush
python setup.py install

Basic Usage

from onepush import get_notifier

n = get_notifier('bark')
print(n.params)

response = n.notify(device_key='YOUR_BARK_KEY', title='OnePush', content='Hello World!')
print(response.text)

# {'required': ['device_key'], 'optional': ['title', 'subtitle', 'body', 'markdown', 'device_key', 'device_keys', 'level', 'volume', 'badge', 'call', 'autoCopy', 'copy', 'sound', 'icon', 'image', 'group', 'ciphertext', 'isArchive', 'url', 'action', 'id', 'delete', 'cipherkey', 'ciphermethod', 'base_url', 'content', 'key']}
# {"code":200,"message":"success","timestamp":1633528319}

Or:

from onepush import notify

notify('bark', device_key='YOUR_BARK_KEY', title='OnePush', content='Hello World!')

You can also use the alias key for device_key:

notify('bark', key='YOUR_BARK_KEY', title='OnePush', content='Hello World!')

Proxy Support

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', 
       device_key='YOUR_BARK_KEY', 
       title='OnePush', 
       content='Hello World!',
       proxies=proxies)

The proxies parameter accepts the same format as the requests library.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onepush-1.9.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onepush-1.9.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file onepush-1.9.0.tar.gz.

File metadata

  • Download URL: onepush-1.9.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.11 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for onepush-1.9.0.tar.gz
Algorithm Hash digest
SHA256 bcca615f367bacc91af982f23c97cadf01e7a60ff14f5a9b1c1fadf90457f45b
MD5 7f74242ed367475d13f1206cdc72ed40
BLAKE2b-256 744a16f86942e2711688c0a63e32993bff7cc515aaa84334bccdd31ee6202cc9

See more details on using hashes here.

File details

Details for the file onepush-1.9.0-py3-none-any.whl.

File metadata

  • Download URL: onepush-1.9.0-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.11 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for onepush-1.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4221505974db5c97d120034488dccfe3b18c8df4e09f9058f57ba005d90f0bd3
MD5 33c205d45aee68c3876af5a01cfe1edb
BLAKE2b-256 9b2b30a7ed4665ab91a69e55a7ab87900e855cae71078f79591ca769e9873e52

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page