Metadata-Version: 2.1
Name: onepush
Version: 1.9.0
Summary: A Python library to send notifications to your iPhone, Discord, Telegram, WeChat, QQ and DingTalk.
Home-page: https://github.com/y1ndan/onepush
Author: y1ndan
Author-email: y1nd4n@outlook.com
License: MIT
Keywords: notify notifier notification push discord telegram wechat qq dingtalk
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests[socks]
Requires-Dist: pycryptodome

# onepush

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

## Supported providers

[Bark](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865), [Discord](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks), [Telegram](https://core.telegram.org/bots), [ServerChan](https://sc.ftqq.com/3.version), [ServerChanTurbo](https://sct.ftqq.com), [WechatWorkApp](https://work.weixin.qq.com/api/doc/90000/90135/90236), [WechatWorkBot](https://work.weixin.qq.com/api/doc/90000/90136/91770), [pushplus](https://www.pushplus.plus/doc), [go-cqhttp](https://docs.go-cqhttp.org), [Qmsg](https://qmsg.zendee.cn/api.html), [DingTalk](https://developers.dingtalk.com/document/app/custom-robot-access), [Lark](https://open.feishu.cn/document/ukTMukTMukTM/ucTM5YjL3ETO24yNxkjN), [SMTP](https://docs.python.org/3/library/smtplib.html), 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

```python
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:

```python
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`:

```python
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:

```python
# 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](https://requests.readthedocs.io/en/latest/user/advanced/#proxies).


