Skip to main content

Fast Web Push (VAPID + AES128GCM) for Python — Rust web-push crate behind a PyO3 binding

Project description

webpush-rs

Fast Web Push (VAPID + AES128GCM) for Python — the Rust web-push crate behind a PyO3 binding.

The VAPID JWT signing and payload encryption run in native Rust; Python sees a single blocking send_one. Compared to a pure-Python sender it roughly halves per-send CPU and adds no Python dependency footprint (the crypto is statically linked, not pulled in as cryptography/http-ece).

End-to-end latency is dominated by the network round-trip to the push service (FCM/Apple), so this is not "faster delivery" — it's lower CPU and memory on the sending host, which matters when fanning out to many subscribers.

Install

pip install webpush-rs        # or: uv pip install webpush-rs

Prebuilt wheels are published for CPython 3.8+ (abi3, one wheel per platform) on Linux (manylinux x86_64 + aarch64), macOS, and Windows.

Usage

import asyncio
import webpush_rs

# send_one is blocking (it drives a small internal Tokio runtime); call it off
# the event loop from async code.
status = await asyncio.to_thread(
    webpush_rs.send_one,
    endpoint,        # subscription.endpoint
    p256dh,          # subscription.keys.p256dh
    auth,            # subscription.keys.auth
    vapid_private,   # url-safe base64 VAPID private key
    "mailto:you@example.com",  # VAPID subject (mailto: or https URL)
    payload_bytes,   # the notification payload
)
# 201 = delivered; 404/410 = endpoint gone (delete the subscription); 0 = error (raises).

License

MIT OR Apache-2.0.

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

webpush_rs-0.1.0.tar.gz (21.2 kB view details)

Uploaded Source

Built Distributions

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

webpush_rs-0.1.0-cp38-abi3-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.8+Windows x86-64

webpush_rs-0.1.0-cp38-abi3-manylinux_2_28_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

webpush_rs-0.1.0-cp38-abi3-macosx_11_0_arm64.whl (2.6 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

webpush_rs-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file webpush_rs-0.1.0.tar.gz.

File metadata

  • Download URL: webpush_rs-0.1.0.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for webpush_rs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c973b79c86af8ffbf3e1c177e033444017bb04132f61a91f4b421ae9bdb06ca4
MD5 c7f80d166f80a183924c8d61367cde48
BLAKE2b-256 c7bd729733024416044745d0a712b29238da9e7ae3bc317dfcfa9c3cd320000d

See more details on using hashes here.

Provenance

The following attestation bundles were made for webpush_rs-0.1.0.tar.gz:

Publisher: release.yml on coseto6125/webpush-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webpush_rs-0.1.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: webpush_rs-0.1.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for webpush_rs-0.1.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 691d10775ea65661350682b04d1752bbc91ba44df0cc05e335c37350f951579f
MD5 2399ab3e600772f3c8cf86dae289329c
BLAKE2b-256 d30d77c7edc7bdf234cfeb42b049fb5e78e8be7d0f9774bad945cda10bc34086

See more details on using hashes here.

Provenance

The following attestation bundles were made for webpush_rs-0.1.0-cp38-abi3-win_amd64.whl:

Publisher: release.yml on coseto6125/webpush-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webpush_rs-0.1.0-cp38-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for webpush_rs-0.1.0-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 40e161445e176e88fe75d53b5d5f11d814c9a0095749ed075e949e2c24f73837
MD5 d470733bcf4342a6af3a6da0e43b9d9c
BLAKE2b-256 5e98c9e013ef82ec1e5af4bb173e2061b76f97002e434b98b16b0ce7c3954033

See more details on using hashes here.

Provenance

The following attestation bundles were made for webpush_rs-0.1.0-cp38-abi3-manylinux_2_28_aarch64.whl:

Publisher: release.yml on coseto6125/webpush-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webpush_rs-0.1.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for webpush_rs-0.1.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dbdce3877b08719c40dd8131171f16626e3e40e108a55b3d6cbac6a53dc48ac5
MD5 4c083f692e2f71b3f550e5320ff435f1
BLAKE2b-256 6bb2a9f6f7c2fe5f116f94dfec68d8b7e5abd454c65d185d47d0c29ee9686903

See more details on using hashes here.

Provenance

The following attestation bundles were made for webpush_rs-0.1.0-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on coseto6125/webpush-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webpush_rs-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for webpush_rs-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7ff24dac93a83cdbdd1308ed27f6520e08cba2424122f3423547737c6d4b67d2
MD5 7741418839a2e93bb4423e44b91d9f71
BLAKE2b-256 8ffe0f379fdb161421992ec3771007f183dad3efad0e462aa5739eada6952fa3

See more details on using hashes here.

Provenance

The following attestation bundles were made for webpush_rs-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on coseto6125/webpush-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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