最简单的python pushover api包装器。

pullover的Python项目详细描述


https://img.shields.io/pypi/status/pullover.svghttps://img.shields.io/pypi/v/pullover.svghttps://img.shields.io/pypi/pyversions/pullover.svghttps://readthedocs.org/projects/pullover/badge/?version=latesthttps://travis-ci.org/gebn/pullover.svg?branch=masterhttps://coveralls.io/repos/github/gebn/pullover/badge.svg?branch=master

最简单的python pushover api包装器。

功能

  • 无无关请求-只需快速发送非紧急消息,无需大惊小怪
  • 旨在正确地掌握基本知识,并对更高级的用例的扩展持开放态度
  • 如果Pushover遇到问题,则超时和自动后退
  • 直观的命令行界面,具有理智、可分析的输出
  • 单元和集成测试
  • 签署的PYPI版本

限制

套头衫不支持:

  • 除了发送消息之外的任何内容
  • 向用户设备的子集发送消息
  • 紧急信息
  • 自定义通知声音

如果你需要这些,我建议你使用karan lyons的Chump包装器。

安装

$ pip install pullover

模块

下面的代码片段演示了pullover的主要特性。有关详细的指南,请参见documentation

高水平

importpulloverresponse=pullover.send('message','user key','app token')ifresponse.ok:print(response.id)# 647d2300-702c-4b38-8b2f-d56326ae460b

低水平

frompulloverimportApplication,User,Message,ClientSendError, \
    ServerSendErrortry:aws=Application('app token')george=User('user key')message=Message('message',title='hello')response=message.send(aws,george)response.raise_for_status()print(response.id)# 647d2300-702c-4b38-8b2f-d56326ae460bexceptClientSendErrorase:# it was our faultprint(e.status,e.errors)exceptServerSendError:# Pushover is having issuesprint(e.response.text)

cli

cli支持与库相同的功能。

$ pullover -a <app_token> -u <user_key> hello!
647d2300-702c-4b38-8b2f-d56326ae460b
$ export PUSHOVER_APP_TOKEN=token
$ export PUSHOVER_USER_KEY=key
$ pullover hello!
647d2300-702c-4b38-8b2f-d56326ae460b
$ pullover --help
usage: pullover [-h] [-V] [-v] -a APP -u USER [-p PRIORITY] [-t TITLE]
                [--timestamp TIMESTAMP] [--url URL] [--url-title URL_TITLE]
                message

The simplest Pushover API wrapper for Python.

positional arguments:
  message               the message content to send

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -v, --verbosity       increase output verbosity
  -a APP, --app APP     the application token to send from; defaults to
                        PUSHOVER_APP_TOKEN
  -u USER, --user USER  the user key to send to; defaults to PUSHOVER_USER_KEY
  -p PRIORITY, --priority PRIORITY
                        the priority of the message, either an integer or
                        string (e.g. '0' or 'normal')
  -t TITLE, --title TITLE
                        the title of the message; defaults to the name of the
                        sending application
  --timestamp TIMESTAMP
                        the timestamp of the message, in ISO 8601 format;
                        defaults to now
  --url URL             a url to include in footer of the message
  --url-title URL_TITLE
                        the URL title; requires --url

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Google Billing Library:QueryPurchaseAsync:取消购买的订阅资源未返回   java转换列表mapsturct中的单个对象   java简单算法。我做不好   包含集合的@ManyToMany映射的java JPA2持久性   在Java中序列化和反序列化对象时发生BuffereImage错误   java使用ui:param传递值并在backingbean中访问它们   java从应用程序读取配置。yml至POJO列表地图   java中在while循环外部调用文件值   java如何与来自不同类的UI交互   java如何在jTable中显示2D数组?   在Java 8中,类为什么不从接口继承默认方法?   java类。getAnnotation和getAnnotations无法正常工作   java处理pagertabstrip上的触摸事件   java GWT和struts2异常   用Java解析HTTP查询字符串   java这段代码SQL注入安全吗?