Skip to main content

Python client for the Pushover.net notification API

Project description

pushovernet

Python client for the Pushover.net notification API.

Installation

pip install pushovernet

For AWS Secrets Manager support:

pip install pushovernet[aws]

Configuration

Create ~/.config/pushovernet/config.toml:

[pushover]
token = "your_app_token"
user_key = "your_user_key"
default_device = ""
default_priority = 0
default_sound = ""

Usage

from pushovernet import PushoverClient

with PushoverClient() as client:
    client.send_message("Hello from pushovernet")

    client.send_message(
        "Server alert",
        title="Alert",
        priority=1,
        sound="siren",
    )

    # Emergency priority (requires retry/expire)
    client.send_message(
        "Critical failure",
        priority=2,
        retry=60,
        expire=3600,
    )

Explicit credentials

client = PushoverClient(token="...", user_key="...")

Environment variables

from pushovernet import PushoverClient, PushoverConfig

config = PushoverConfig.from_env()  # reads PUSHOVER_TOKEN, PUSHOVER_USER_KEY
client = PushoverClient(config=config)

AWS Secrets Manager

from pushovernet import PushoverClient, PushoverConfig

config = PushoverConfig.from_aws_secret("my/pushover/secret", region="us-east-1")
client = PushoverClient(config=config)

The secret JSON should contain token and user_key keys.

Proxy Server

A local REST API proxy so LAN devices can send notifications without knowing your Pushover credentials.

pip install pushovernet[server]

Running

pushovernet-server
python -m pushovernet

Listens on 0.0.0.0:9505 by default. Configure via TOML or environment variables:

[server]
api_key = "my-lan-secret"
host = "0.0.0.0"
port = 9505

Or: PUSHOVERNET_API_KEY, PUSHOVERNET_HOST, PUSHOVERNET_PORT.

Endpoints

Method Path Description
POST /send Send a notification
POST /glance Send glance data
GET /sounds List available sounds
GET /limits Get rate limit status
GET /health Health check

Examples

curl -X POST http://localhost:9505/send \
  -H "Content-Type: application/json" \
  -d '{"message": "hello from the LAN"}'

curl -X POST http://localhost:9505/send \
  -H "Content-Type: application/json" \
  -H "X-API-Key: my-lan-secret" \
  -d '{"message": "alert", "title": "Server", "priority": 1}'

API Coverage

  • Messages: send, with attachments, emergency priority
  • User validation
  • Receipts: query, cancel, cancel by tag
  • Sounds: list available sounds
  • Rate limits: query app limits
  • Groups: create, list, get, add/remove/enable/disable users, rename
  • Glances: send glance data
  • Subscriptions: migrate
  • Licenses: assign, get credits

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

pushovernet-0.1.3.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pushovernet-0.1.3-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file pushovernet-0.1.3.tar.gz.

File metadata

  • Download URL: pushovernet-0.1.3.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for pushovernet-0.1.3.tar.gz
Algorithm Hash digest
SHA256 51a7c90d10e9efb478f69c39ae6e53024ab580a89e2ab1f0dd26551a170e42a9
MD5 4928b5a224ac813fe7f195e1c0ed928b
BLAKE2b-256 11824464de3b629f6e87731eebfce1aaf87bce1959a49929783a9a410ab4a128

See more details on using hashes here.

File details

Details for the file pushovernet-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pushovernet-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for pushovernet-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4d64e7bdd5da16c684f511138ab2ed7f237c21e56e401b5b4c3dc6e192968c01
MD5 37b6ddd85602813d201bbd5f606aa7aa
BLAKE2b-256 dbbad07ab7fcb6e9694bf293fb021db12e62af4c9b385a006655c5384f21de82

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page