Python SDK 10.9.1
Real-time messaging, presence, and storage for Python servers, scripts, and services.
pip install pubnub
What do you want to do?
- Configure access controlEnable Access Manager on your keyset.
- Initialize a server SDK with a secret keySet up the server that issues tokens.
- Initialize a client SDK with an auth keyGive a client its token at startup.
- Grant, change, and revoke permissionsIssue, update, and revoke tokens.
- Update an expired tokenRecover a client after a 403 error.
API reference
Publish
Send messages and signals.
Subscribe
Listen for messages and events.
Configuration
Initialize the client and set options.
Access Manager
Tokens and permissions.
Presence
Online status, occupancy, and state.
Message Persistence
Fetch, count, and delete history.
File Sharing
Upload, download, and list files.
Channel Groups
Subscribe to many channels at once.
Message Actions
Reactions and receipts.
Mobile Push
Push notifications for mobile apps.
Encryption
Encrypt files and part of a message.
App Context
Users, channels, and memberships.
Miscellaneous
Utility methods.
Work with the SDK
Set up your environment
Install the SDK in a virtual environment.
Status events
Connection and error categories.
Reconnection policies
Control how the SDK retries after a network loss.
Logging
Turn on and read SDK logs.
Troubleshooting
Find the SDK version and handle errors.
Platform support
Supported operating systems and Python versions.
Feature support
What each SDK version supports.
Changelog
Release notes for every version.
FAQ
Common questions about the SDK.