Python SDK for Azure Web PubSub
Project description
Azure Web PubSub
Python SDK for Azure Web PubSub
Disclaimer
Unless you need something decently simple (e.g. server-to-client one-way communication), I think Socket.IO may be a better option. Azure Web PubSub has a managed service for Socket.IO (read more here), or you can host your own server with python-socketio
Installation
pip install pubsub-az
Authorization
PUBSUB_CONN_STR
(Connection string in the portal)
Environment (.env)
For convenience, you can set os.environ["PUBSUB_CONN_STR"]
and can skip specifying it on every call.
E.g., create a .env
file:
PUBSUB_CONN_STR="<PUBSUB_CONN_STR>"
Then load it before importing
from dotenv import load_dotenv
load_dotenv()
import pubsub_az as pz
pz.service(hub='<hub>') # just works!
CLI
Basic listener priting messages received. To install, run:
pip install pubsub-az[client]
Then, to execute from the terminal:
pubsub-client --user "<user-id>" --hub "<hub>" --groups "<g1>" "<g2>" # ...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pubsub-az-0.1.2.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for pubsub_az-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ce091f86ec7c907c945dfe44605d5cea0cd7f2b13e3d7b2ad147fe14be266aa |
|
MD5 | 1976980d924e6655cfed92c1e3549d0a |
|
BLAKE2b-256 | 2dfb6fc705fd464ab026490afe2275a9fedf83249f074bcbeaf14c6f7fa51282 |