Skip to main content
https://github.com/pusher/push-notifications-python/workflows/CI/badge.svg https://codecov.io/gh/pusher/push-notifications-python/branch/master/graph/badge.svg

Pusher Beams Python server SDK

Full documentation for this SDK can be found here

Installation

The Pusher Beams Python server SDK is available on PyPi here.

You can install this SDK by using pip:

$ pip install pusher_push_notifications

Usage

Configuring the SDK for Your Instance

Use your instance id and secret (you can get these from the dashboard) to create a Beams PushNotifications instance:

from pusher_push_notifications import PushNotifications

beams_client = PushNotifications(
    instance_id='YOUR_INSTANCE_ID_HERE',
    secret_key='YOUR_SECRET_KEY_HERE',
)

Publishing to Device Interests

You can broadcast notifications to groups of subscribed devices using Device Interests:

response = beams_client.publish_to_interests(
    interests=['hello'],
    publish_body={
        'apns': {
            'aps': {
                'alert': 'Hello!'
            }
        },
        'fcm': {
            'notification': {
                'title': 'Hello',
                'body': 'Hello, World!'
            }
        }
    }
)

print(response['publishId'])

Publishing to Authenticated Users

Securely send notifications to individual users of your application using Authenticated Users:

response = beams_client.publish_to_users(
    user_ids=['user-0001'],
    publish_body={
        'apns': {
            'aps': {
                'alert': 'Hello!'
            }
        },
        'fcm': {
            'notification': {
                'title': 'Hello',
                'body': 'Hello, World!'
            }
        }
    }
)

print(response['publishId'])

Metadata

Release files for pusher-push-notifications 2.0.2

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

Source distribution (sdist)

Source distribution for pusher-push-notifications 2.0.2
File Size Uploaded
pusher_push_notifications-2.0.2.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pusher-push-notifications 2.0.2
File Interpreter ABI Platform
pusher_push_notifications-2.0.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 15.6 kB

Release files / pusher_push_notifications-2.0.2.tar.gz

Download URL pusher_push_notifications-2.0.2.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6c6ef66aa0923f7c11300a60ba0a0adc4f9bd05b5b882912d47b838b5994d9d8
BLAKE2b-256 checksum
How to use checksums
53a616e3806696ab849ae2bead193f45c561e1f6edbaecabc6c80dd2816603a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.1

Release files / pusher_push_notifications-2.0.2-py2.py3-none-any.whl

Download URL pusher_push_notifications-2.0.2-py2.py3-none-any.whl
Size 6.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
abda37e8ca54b53409e1d4520a39318cdef66fb88556c509757ed7a63d4d7921
BLAKE2b-256 checksum
How to use checksums
51db3e13265d23a4131490d43ab12758a82d9b2212004bb8dd4db91e2102904c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.1

Release history Release notifications | RSS feed

This release

2.0.2 This release

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.2

1 release file

0.9.1

1 release file

0.9.0

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