Skip to main content

A simple Pushover client written in Python.

Project description

pushover-client


This package provides an easy-to-use Python 3 interface for the Pushover API. Written in pure Python off the requests module.


Install

python3 -m pip install git+https://github.com/Nythepegasus/pushover-client/

Supported Features

Client

  • send: Send a Message/Glance through the API.
  • verify_user: Verifies that the current user_token and api_key are valid and working.
  • get_limits: Get the current api_key's limits.
  • get_receipt: Gets the receipt of a priority 2 Message.

Message

  • message: The message of the notification, can contain HTML.
  • title: An optional title message.
  • attachment: An optional png/jpeg image attachment.
  • device: Optionally specify a specific device to send it to.
  • url: An optional supplementary URL.
  • url_title: An optional title for the supplementary URL.
  • priority: The priority at which the message is sent.
  • sound: The sound that plays when the notification arrives.
  • timestamp: The UNIX timestamp that the message is marked with.
  • retry: Number of seconds to retry sending a priority 2 message.
  • expire: Number of seconds when to stop retrying to send a priority 2 message.

Glance

  • title: An optional title for the Glance.
  • text: A line of text to display with the Glance.
  • subtext: A second line of text to display with the Glance.
  • count: The number to display on the Glance widget.
  • percent: The percentage to display on the Glance widget.

Examples

A simple example to send a message through the API:

from pushover import Client, Message
client = Client("user_token", "api_token")
msg = Message("This is a sample message!", title="Howdy!")
r = client.send(msg)
print(r.status_code)
# 200 if sent correctly 

A simple way to send a Glance through the API:

from pushover import Client, Glance
client = Client("user_token", "api_token")
glance = Glance(title="Howdy!", count=100, percent=84)
r = client.send(glance)
print(r.status_code)
# 200 if sent correctly

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

pushover-nythepegasus-1.0.1.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

pushover_nythepegasus-1.0.1-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

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