Pullover

The simplest Pushover API wrapper for Python, release v1.0.0.

https://img.shields.io/pypi/l/pullover.svg https://img.shields.io/pypi/pyversions/pullover.svg

Send a message

To send a message, simply:

>>> import pullover
>>> pullover.send('message', 'user', 'app')

You can additionally pass any parameters accepted by Message‘s initialiser.

pullover.send(body, user_key, app_token, **kwargs)

Send a message to a user from an application.

Parameters:
  • body (str) – The body of the message to send.
  • user_key (str) – The user key to send to.
  • app_token (str) – The application token to send from.
  • kwargs – Additional keyword arguments to pass to Message‘s initialiser.
Returns:

A message send response instance.

Return type:

SendResponse

Querying the response

pullover.send() returns a SendResponse object, from which the status, request ID and any errors can be retrieved.

>>> response = pullover.send('message', 'user', 'app')
>>> response.ok
True
>>> response.id
5042853c-402d-4a18-abcb-168734a801de
>>> response.status
1
>>> response.errors
[]

If you’d like to use exceptions, raise_for_status() will raise either a ClientSendError or ServerSendError if ok is False.

class pullover.message.SendResponse(response)

Represents the Pushover API’s response to a message send request.

ok

Find whether the response indicates the message was successfully sent.

Returns:True if it was, false otherwise.
Return type:bool
raise_for_status()

Raise an appropriate exception given this response.

Raises:SendError – If this response indicates a request failed.