# PushNotifier (V2) for Python
[![PyPI version](https://badge.fury.io/py/pushnotifier.svg)](https://badge.fury.io/py/pushnotifier)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pushnotifier.svg)
![GitHub contributors](https://img.shields.io/github/contributors/tomg404/pushnotifier-python.svg)
![Codacy grade](https://img.shields.io/codacy/grade/c7eb50b6f38b48aca431fc576ff7eb29.svg)
![GitHub repo size](https://img.shields.io/github/repo-size/tomg404/pushnotifier-python.svg)
![GitHub](https://img.shields.io/github/license/tomg404/pushnotifier-python.svg)
A python module to easily use the service of [PushNotifier](https://pushnotifier.de) in your python projects.
Special thanks go to [@Logxn](https://github.com/Logxn).
## About
Easily send
- messages
- urls
- images
via python to all your devices. For more info visit [pushnotifier.de](https://pushnotifier.de)
## Installation
**Note: you have to have `requests` installed (`pip install requests`)**
- Install PushNotifier via pip
```console
foo@bar:~$ pip install pushnotifier
```
- Install PushNotifier manually
```console
foo@bar:~$ git clone https://github.com/tomg404/pushnotifier-python
foo@bar:~$ cd /path/to/repository/
foo@bar:~$ python setup.py install
```
## Usage
```python
from pushnotifier import PushNotifier as pn
pn = pn.PushNotifier('username', 'password', 'package_name', 'api_key')
```
### Sending messages
```python
>>> pn.send_text('hello world', silent=False)
>>> pn.send_url('https://www.example.com', silent=True)
>>> pn.send_notification('hello world', 'https://www.example.com') # by default silent is set to False
>>> pn.send_image('path/to/image.png')
```
### Get Basic information
```python
>>> password = 'XXXXX'
>>> pn.login(password)
{'username': 'username', 'avatar': 'https://gravatar.com/avatar/XXXXX', 'app_token': 'XXXXX', 'expires_at': XXXXX}
>>> pn.get_all_devices()
['abcd', 'efgh', 'ijkl']
```
### Refresh app token
```python
>>> pn.refresh_token()
'new_token'
```
### More detailed help
```python
>>> help(pn.some_method_you_need_help_on)
```
PyPI 官网下载 | pushnotifier-1.2.1.tar.gz
版权申诉
28 浏览量
2022-02-01
18:14:24
上传
评论
收藏 4KB GZ 举报
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
最新资源
- VIVADO中UART IP核使用
- 【深度学习实际案例解析】深度学习实际案例解析
- 封装swagger组件,提供全新UI以及无状态登录接口调用解决方案
- 小龙坎支局2024年4月渠道积分核对数据.xlam
- onlyoffice搭建及与alist使用的view.html
- Quadcopter-UAV-attitude-estimation-linux常用命令大全demo
- Quadcopter-UAV-attitude-estimation-based-on-数据库课程设计
- pbdlib-python-master.zip
- 43904245495352013_base.apk
- 基于springboot+vue + redis的工作流审批系统
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈