JustPush — Python SDK
The official Python SDK for JustPush. Send push notifications to your iOS and Android devices from any Python script, server or Home Assistant integration.
- A sync client that uses only the standard library, and an async client on
aiohttp - Typed models for buttons, button groups, images, sounds and acknowledgements
- Checks the message before sending it, so you get a clear error instead of a rejected request
- Rate-limit information on every send
Installation
pip install justpush
Python 3.10 or newer.
Send a message
from justpush import JustPush
client = JustPush("YOUR_API_TOKEN")
result = client.send("The nightly backup finished", title="Backups")
print(result.key) # use it with get_message()
print(result.rate_limit.remaining) # messages left this month
Get your API token from the JustPush app.
Everything a message can do
from justpush import Acknowledgement, Button, ButtonGroup, Image, JustPush, Priority, Sound
client = JustPush("YOUR_API_TOKEN")
client.send(
"Water detected under the washing machine",
title="💧 Leak",
topic="Home", # topic name; created if it doesn't exist yet
priority=Priority.HIGHEST, # or 2, or "highest"
sound=Sound.SIREN, # or "siren"
buttons=[Button("Open camera", "https://example.com/cam")],
images=[Image.from_file("snapshot.jpg", caption="Kitchen")],
expiry=3600, # hide the message after an hour
acknowledge=Acknowledgement(
retry=True, interval=60, max_retries=10,
callback_url="https://example.com/acknowledged",
callback_params={"sensor": "kitchen"},
),
)
| Argument | |
|---|---|
message, title |
At least one is required. Titles over 255 characters are cut short. |
topic |
A topic name. An existing topic with that name is used, or a new one is created. |
topic_token |
Target a topic by its API token instead (Topic.api_token). |
priority |
-2…2, a Priority, or "lowest", "low", "normal", "high", "highest". |
sound |
A Sound, or its name in any case. Sound.NONE is silent. |
buttons |
Up to 10 Button(cta, url, action_required=False). Labels over 25 characters are cut. |
button_groups |
Up to 4 ButtonGroup(name, cta, buttons), each with up to 10 buttons. |
images |
Up to 10 Image(url=…) or Image.from_bytes(…) / Image.from_file(…). The first one becomes the notification banner. |
expiry |
Seconds until the message is hidden. |
acknowledge |
True, or an Acknowledgement for retries (interval 10–65535 s, max_retries 0–255) and a callback URL. |
Check a message
details = client.get_message(result.key)
print(details.is_acknowledged, details.processed_at)
Check a token
client.verify_token() # raises JustPushAuthenticationError if the token is invalid
This sends nothing and uses no quota, so it's safe for setup screens.
Async
import asyncio
from justpush import AsyncJustPush
async def main():
async with AsyncJustPush("YOUR_API_TOKEN") as client:
await client.send("Someone rang the doorbell", title="🔔 Doorbell")
asyncio.run(main())
Pass session= to reuse your own aiohttp.ClientSession, for example
async_get_clientsession(hass) in a Home Assistant integration. The client never closes
a session it didn't create.
Topics
topic = client.create_topic("Servers", avatar_url="https://example.com/server.png")
client.update_topic(topic.uuid, title="Production servers")
client.get_topic(topic.uuid)
client.send("Disk almost full", topic_token=topic.api_token)
Errors
Every error is a JustPushError.
| Exception | When |
|---|---|
JustPushValidationError |
The message is invalid, either caught before sending or a 422 from the API. .errors holds per-field messages. It's also a ValueError. |
JustPushAuthenticationError |
401: the token is missing or wrong. |
JustPushForbiddenError |
403: not allowed, e.g. a topic you don't own, or a plan limit. |
JustPushNotFoundError |
404: unknown message key or topic. |
JustPushSubscriptionError |
410: the subscription expired. |
JustPushRateLimitError |
429: too many requests; see .retry_after. |
JustPushAPIError |
Any other error status; see .status and .body. |
JustPushConnectionError |
Network error or timeout (default 10 s, change with timeout=). |
Development
python3 -m venv .venv && .venv/bin/pip install -e '.[dev]'
.venv/bin/pytest
.venv/bin/ruff check . && .venv/bin/mypy
Changelog
See CHANGELOG.md.
Metadata
Release files for justpush 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| justpush-0.2.0.tar.gz | 16.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| justpush-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.5 kB
Release files / justpush-0.2.0.tar.gz
| Download URL | justpush-0.2.0.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa3a312bd8581d06f18a1408d5d4befaf093e7a92ae9a29b9579189da79c3bf3
|
|
BLAKE2b-256 checksum How to use checksums |
75c519470456717631f950445ea6775363780e3d38251d5284c158b076156c97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / justpush-0.2.0-py3-none-any.whl
| Download URL | justpush-0.2.0-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cdbf3f08537e79d1a313a920d144cf1064b3f9b0e07616429f8c772b548c16b7
|
|
BLAKE2b-256 checksum How to use checksums |
5aa51dc6ae40a971d4b9ac9efe2e17431d81abd8d4987fa72339b564a7ad6114
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency log