pubnub
PubNub Real-time push service in the cloud
What it is and what it does
PubNub is a cloud-hosted real-time messaging platform with an official Python SDK that handles the infrastructure for sending and receiving messages globally. The SDK manages publish-subscribe channels, presence detection, signal delivery, and event callbacks through a configuration-based setup and listener pattern.
The package wraps PubNub's REST API and WebSocket infrastructure, abstracting away network complexity so developers can focus on application logic. It supports asynchronous operations via callbacks, integrates with multiple HTTP backends (requests, httpx, aiohttp), and includes cryptographic message signing through pycryptodomex. The SDK is actively maintained, supports Python 3.9 through 3.13, and carries no known security vulnerabilities.
Use it for:
- Build real-time chat or messaging applications where messages must arrive globally in under 100ms.
- Implement presence tracking to show which users are currently online or active in your application.
- Send event notifications and signals across distributed services without managing your own message broker.
- Create collaborative applications where multiple clients need to synchronize state changes instantly.
- Monitor and react to status events such as connection failures, authentication issues, or network changes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PubNub Python SDK provides real-time publish-subscribe messaging and presence detection across distributed applications, handling message delivery, subscriptions, and event listeners.
Yes, if you need a managed real-time messaging service and accept the proprietary license. The SDK is production-stable, actively maintained, has no known vulnerabilities, and supports modern Python versions. The high install friction (six dependencies) is typical for a full-featured messaging client. Verify the license terms for your use case before committing.
Install
pubnub on PyPI
pip
pip install pubnubuv
uv add pubnubpoetry
poetry add pubnubInstalling pubnub
Before you install
High install friction due to six runtime dependencies including pycryptodomex, httpx, h2, requests, aiohttp, and cbor2. Active maintenance with a release 37 days ago and recent commits indicate ongoing support.
License in practice
License treatment is unclear—the package uses a proprietary 'PubNub Software Development Kit License' with no SPDX identifier. Review the license terms directly before adopting in commercial or open-source projects.
Quickstart
pip install pubnub
from pubnub.pnconfiguration import PNConfiguration
from pubnub.pubnub import PubNub
pnconfig = PNConfiguration()
pnconfig.subscribe_key = 'mySubscribeKey'
pnconfig.publish_key = 'myPublishKey'
pnconfig.uuid = 'myUniqueUUID'
pubnub = PubNub(pnconfig)
pubnub.publish().channel('my_channel').message('Hello world!').pn_async(callback)
Requires Python 3.9 or later; publish and subscribe keys must be obtained from the PubNub Admin Portal.
Verify before relying
- Whether the proprietary license permits use in commercial applications without additional agreements.
- Performance characteristics and latency guarantees under typical production loads.
- Whether all six runtime dependencies are always required or if some are optional for specific use cases.
Package facts
| License | PubNub Software Development Kit License (unclear) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | high — source build required |
| Runtime dependencies | 6 — pycryptodomex, httpx, h2, requests, aiohttp, cbor2 |
| Maintenance | actively maintained — 37 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 244,128/month — #8,762 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pubnub-10.7.2.tar.gz
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
ablyAbly is a Python client library for connecting…
permissive · top 5,000 on PyPI
PypubsubProvides a publish-subscribe messaging system…
permissive · top 15,000 on PyPI
slixmppSlixmpp is an async-first XMPP library for…
permissive · top 15,000 on PyPI
solace-pubsubplusSolace Messaging API for Python provides client…
permissive · top 15,000 on PyPI
broadcasterBroadcaster provides a simple async broadcast…
permissive · top 15,000 on PyPI
neonizeNeonize is a Python library for automating…
unclear · top 15,000 on PyPI
firebase-messagingReceives push notifications sent via Firebase…
permissive · top 15,000 on PyPI
google-cloud-pubsubPython client library for Google Cloud Pub/Sub,…
permissive · top 1,000 on PyPI
lcmLCM provides publish/subscribe message passing…
unclear · top 15,000 on PyPI
pusherPusher is a Python client library for the…
permissive · top 5,000 on PyPI