Skip to main content

The simplest Pushover API wrapper for Python.

Project description

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

The simplest Pushover API wrapper for Python.

Features

  • No extraneous requests - just sends non-emergency messages quickly and without fuss

  • Aims to get the basics right, and be open to extension for more advanced use cases

  • Timeouts and automatic back-off should Pushover be experiencing issues

  • Intuitive command-line interface with sane, parseable output

  • Unit and integration tested

  • Signed PyPi releases

Limitations

Pullover does not support:

  • Anything other than sending messages

  • Sending messages to a subset of a user’s devices

  • Emergency messages

  • Customising the notification sound

If you need one of these, I’d recommend using Karan Lyons’s Chump wrapper.

Installation

$ pip install pullover

Module

The following code snippets demonstrate the main features of pullover. For an exhaustive guide, see the documentation.

High-level

import pullover

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

Low-level

from pullover import Application, User, Message, ClientSendError, \
    ServerSendError

try:
    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-d56326ae460b
except ClientSendError as e:
    # it was our fault
    print(e.status, e.errors)
except ServerSendError:
    # Pushover is having issues
    print(e.response.text)

CLI

The CLI supports the same functionality as the library.

$ 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

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

pullover-1.1.1.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

pullover-1.1.1-py2.py3-none-any.whl (20.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pullover-1.1.1.tar.gz.

File metadata

  • Download URL: pullover-1.1.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pullover-1.1.1.tar.gz
Algorithm Hash digest
SHA256 ded4b33d8f7383996ed40dba063b79b6a4662ee0512ed11c2bc4dd1273669fb9
MD5 2d4a0f1f4eb98b7b103eb55c4011d004
BLAKE2b-256 f12a6b3623e39a68f0c57638a7742795b895ae72375b79c5cebb3312120127aa

See more details on using hashes here.

File details

Details for the file pullover-1.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pullover-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3a3c09d84a4e0572fa2a0611de312a36e4759ed28e3c60e40142a0cedd2f877a
MD5 c62fa8008e54d3cbe5a5a8b759a867d9
BLAKE2b-256 d6027d0925fac6dc75578d2633645c8cadb7f17f51da032c44e8fc6b940963e3

See more details on using hashes here.

Supported by

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