Skip to main content

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


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)

Uploaded Source

Built Distribution

pubsub_az-0.1.2-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page