Skip to main content

Info

This is a fork of the python-pushover project from https://github.com/Thibauth/python-pushover.git It seems that it is no longer maintained and the latest code changes weren’t published as release. So at the moment this fork has no real code changes, but provides a new release and publishing to pypi.

The below documentation seems to be outdated.

About

python-pushover aims at providing comprehensive Python bindings for the API of the Pushover Notification Service as documented here.

Installation

You can install python-pushover from Pypi with:

$ pip install python-pushover

Or you can install it directly from GitHub:

git clone https://github.com/Thibauth/python-pushover.git
cd python-pushover
pip install .

Overview

After being imported, the module must be initialized by calling the init function with a valid application token. Thus, a typical use of the pushover module looks like this:

from pushover import init, Client

init("<token>")
Client("<user-key>").send_message("Hello!", title="Hello")

You can also pass the api_token optional argument to Client to initialize the module at the same time:

from pushover import Client

client = Client("<user-key>", api_token="<api-token>")
client.send_message("Hello!", title="Hello")

Attachments can be sent with the attachment parameter which takes as argument as file object:

with open('/path/to/my/image.png', 'rb') as image:
    client.send_message('Message with image', attachment=image)

Command line

python-pushover also comes with a command line utility pushover that you can use as follows:

pushover --api-token <api-token> --user-key <user-key> "Hello!"

Use pushover --help to see the list of available options.

Configuration

Both the pushover module and the pushover command line utility support reading arguments from a configuration file.

The most basic configuration file looks like this:

[Default]
api_token=aaaaaa
user_key=xxxxxx

You can have additional sections and specify a device as well:

[Sam-iPhone]
api_token=bbbbbb
user_key=yyyyyy
device=iPhone

python-pushover will attempt to read the configuration from ~/.pushoverrc by default. The section to read can be specified by using the profile argument. With the configuration file above, you can send a message by simply doing:

from pushover import Client

Client().send_message("Hello!", title="Hello")

or pushover --title "Hello" "Hello!" from the command line.

API

You can access the full API documentation here.

Contributors

Changes

0.4 (2018-05-13)

  • Add support for expire and retry parameters to the command line for priority=2 messages

  • Add support for attachments

0.3 (2016-12-29)

  • Add support for the Glances API

  • Add a cancel function to MessageRequest objects to cancel high priority messages

  • Add support for html message styling

  • Fix bug in MessageRequest.poll for priority=2 requests

0.2 (2014-08-16)

  • Fix bug when using current timestamp

  • Add a pushover command line utility

  • Add Python 3 support

  • Add configuration file feature

  • Easier and more compact Client class creation

  • Switch to setuptools for easier installation and dependencies handling

0.1 (2013-04-16)

Initial Release

Metadata

Release files for softxperience-pushover 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for softxperience-pushover 1.0
File Size Uploaded
softxperience-pushover-1.0.tar.gz 19.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for softxperience-pushover 1.0
File Interpreter ABI Platform
softxperience_pushover-1.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.3 kB

Release files / softxperience-pushover-1.0.tar.gz

Download URL softxperience-pushover-1.0.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1fe7ccb96249f2073b4a3e99325878c6bfb14c27f77dfbf0b781957620b01fd9
BLAKE2b-256 checksum
How to use checksums
e156e7e3f115bd843189601dd48a27af9d728f0968dda91dc10f470e378077bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release files / softxperience_pushover-1.0-py3-none-any.whl

Download URL softxperience_pushover-1.0-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53fa43e9f1fa9706c9dc0d73c46e0fe6da1f02d27416722fc196b2a8d97421d8
BLAKE2b-256 checksum
How to use checksums
653373299c17c50ecf10b91820f945c1ee0c9bf177d3daafa2e442aa407ff652
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page