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.
Custom Headers
The custom provider accepts a headers parameter, useful for webhooks that require authentication or other custom headers:
from onepush import notify
notify('custom',
url='https://example.com/webhook',
method='post',
datatype='json',
data={'foo': 'bar'},
headers={
'Content-Type': 'application/json',
'X-API-Key': 'YOUR_API_KEY',
})
The headers parameter uses the same format as the headers argument in the requests library, and is optional. When omitted, no extra headers are added by onepush.
Metadata
Release files for onepush 1.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| onepush-1.11.0.tar.gz | 13.9 kB | Without provenance | Details for onepush-1.11.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| onepush-1.11.0-py3-none-any.whl | Python 3 | none | any | Details for onepush-1.11.0-py3-none-any.whl |
Total release size: 34.1 kB
Release files / onepush-1.11.0.tar.gz
| Download URL | onepush-1.11.0.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ca99ee8d5f9101a35c216ff39e8d3af8863ccc6398a9ad69f815b339509caa3
|
|
BLAKE2b-256 checksum How to use checksums |
3df82075e7239d1bfd9286b9fb8f0f640af5df64e4dacc381050405dea826521
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Release files / onepush-1.11.0-py3-none-any.whl
| Download URL | onepush-1.11.0-py3-none-any.whl |
|---|---|
| Size | 20.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a2fbc379ab585ffed92a3b1b1241eaab310beda9cb9b44be9e890b70caeae94b
|
|
BLAKE2b-256 checksum How to use checksums |
40df447c6f6579046f893c5693befd058ef9dbe8056d2700925270569e26862b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Security for onepush 1.11.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.