Pullover¶
The simplest Pushover API wrapper for Python, release v1.0.0.
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: Returns: A message send response instance.
Return type:
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
.