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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file pubsub-az-0.1.2.tar.gz.

File metadata

  • Download URL: pubsub-az-0.1.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for pubsub-az-0.1.2.tar.gz
Algorithm Hash digest
SHA256 03dd7602d7fe96b566685a0de3403ed87f6373d53abb1edb321c0d861fb1e7e1
MD5 1984eed2217c612c2146cb9947196094
BLAKE2b-256 0f9d04b8b3b393113d0a9283d1f650191d5b146b2fe0587748b8078797956cb0

See more details on using hashes here.

File details

Details for the file pubsub_az-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pubsub_az-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for pubsub_az-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2ce091f86ec7c907c945dfe44605d5cea0cd7f2b13e3d7b2ad147fe14be266aa
MD5 1976980d924e6655cfed92c1e3549d0a
BLAKE2b-256 2dfb6fc705fd464ab026490afe2275a9fedf83249f074bcbeaf14c6f7fa51282

See more details on using hashes here.

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