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.4.tar.gz (18.5 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.4-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pushovernet-0.1.4.tar.gz
  • Upload date:
  • Size: 18.5 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.4.tar.gz
Algorithm Hash digest
SHA256 3bcdaec38f5bdc6b444386e5b9477340c2b9e76ef0a9b603001f3137202d4be2
MD5 e326a14157b5e16cfd91ff06a32d7487
BLAKE2b-256 010915d8e17e74c3ddce6cec612a4ec229ba2672e898a139954c16bec2315191

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pushovernet-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 12.9 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c0647703015658a19812cfa79bb5f8c6b2efcbe073e2b4e85c0646ed6d5c7cac
MD5 504ccb1b6a018a657789d507b5309fcb
BLAKE2b-256 378cb1df0d3f9f658bb4365382934add4a50a63d9f6f1f593e6120bce400ac2f

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