skillfed

pubnub

PubNub Real-time push service in the cloud

pubnub v10.7.2 244.1K downloads/30d#8,762 on PyPI167
License unclear PubNub Software Development Kit License Active released

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 pubnub

uv

uv add pubnub

poetry

poetry add pubnub

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: Other/Proprietary LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Internet :: WWW/HTTPTopic :: Software Development :: Libraries :: Python Modules

Tags

real-time messaging sdkpublish subscribe pythonpush notifications clouddistributed messaging serviceevent streaming platformpresence detection messagingglobal message delivery
realtime-messagingmanaged-serviceevent-driven

More Python Modules packages