Skip to main content

PushOver Push Notification API Module

A single Python Module that allows for the interaction with PushOver's Push Notification API. PushOver offers a service that makes it really easy to send Push Notification to devices (laptops, phones, etc). This is all accomplished easily through the use of POST Requests to their API Endpoint. This module just takes the easy to use service and wraps it up in a nice and quick way to allow for quicker script writing.

Set up:

  1. Get an account at: https://pushover.net/ (This is the "Dashboard" URL once signed in)
  2. Copy example.env and rename it to .env
  3. Grab the "User Key" and add it to the designated place (USER_KEY) in the .env, found in the root of the project directory (pushover/)
  4. Next create your application through: https://pushover.net/apps/build
  5. Grab the "API Token/Key" (we'll call it a "API Token" because the POST calls it a Token so therefore it is a TOKEN). Add the API Token to the designated place (API_TOKEN) in the .env
  6. Finally run: pip install -r requirements.txt
  7. DON'T FORGET TO ADD A DEVICE AND INSTALL THE APP ON YOUR PHONE OR HAVE THE BROWSER REGISTERED! This can be done through the Dashboard.

Usage and Limitations:

Once you have completed the set up, you should be ready to use the module. There are some limitations the PushOver Push Notification API. These limitations are actually also handled within the python module itself, as validation, to help avoid users of this module from wasting API Calls and wasting their time. Before using the module make sure to give a quick glance to the limitations: https://pushover.net/api#limits.

None of the limitations are particularly major. Mainly max length restrictions on URLs and Text, and then Byte Size limits on Images.

Usage

from simple_pushover import PushoverAPI

# first create a PushoverAPI instance
api = PushoverAPI()
# To send a message (under 1024 Characters...) You can use the simple_send_push or the more featureful send_push.
# Really only the message kwarg is required.
api.simple_send_push(message="Hello World")

# You can also add the priority kwarg to set the priority level (-2 thru 2). I.E. priority=1 sends a message with a High Priority. It should be noted that the default is 0 which is normal priority
api.simple_send_push(message="Hello World", priority=1)

# For more complex Push notifications you can use:
api.send_push(
    title="Test Title",
    message="This is an example of a more complex push notification.",
    url="https://example.com/",
    url_title="Link Display Title",
    attachment="path/to_img.png",
    priority=1
)
# Once again the only required kwarg is message. However If you pass the kwarg url_title, you must also pass a URL.

Future Enhancements:

I may add some other minor pieces to the module to help with other APIs that PushOver offers ( maybe once I have a need for them :^) ). The Push Notification still has some touch ups needed which can be found below...

TO DO:

  • Add filetype validation to the image attachments... Technically their API only handles images as attachments according to their API. I forgot to add that check, DOH!
  • Add HTML parsing options

Metadata

Release files for simple-pushover 0.0.5

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

Source distribution (sdist)

Source distribution for simple-pushover 0.0.5
File Size Uploaded
simple_pushover-0.0.5.tar.gz 17.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simple-pushover 0.0.5
File Interpreter ABI Platform
simple_pushover-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 34.5 kB

Release files / simple_pushover-0.0.5.tar.gz

Download URL simple_pushover-0.0.5.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0ef3e1dac56f722cb4f820bd0a52bfe9105c7aeb843c5e287b0c6314f4b56a2e
BLAKE2b-256 checksum
How to use checksums
7cbd33c8dfcd7e69fb2e419718d64804327b315ec661e8bbb91e56c1a13615be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / simple_pushover-0.0.5-py3-none-any.whl

Download URL simple_pushover-0.0.5-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6098c8ea495b29d0d37322b284aecc1dbe933da84d31f3f07a349b77ecf6dc30
BLAKE2b-256 checksum
How to use checksums
39ea798be3a384416ea57469451832b43c686321e5686387206e2186e18634ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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