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.1.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for pubsub_az-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1655f906fc84ef83fb9b78322a8a6200f1864ec1722c07f66738199f5d266b1f |
|
MD5 | 190c4f5c9a4028b75afaf571bcd4e08c |
|
BLAKE2b-256 | 0f99b35cefb817f59b9a02dc35fe858b3412732ddc0fc7f57be7652c13792513 |