Skip to main content

No project description provided

Project description

jupyter-ws-tunnel

A WebSocket-shaped client and an ASGI server bridge that transparently falls back to a Jupyter widget comm when a real WebSocket can't be proxied (e.g. hosted Google Colab) — the same client code and the same ASGI app work in both deployments unchanged.

Install

pip install jupyter-ws-tunnel
npm install jupyter-ws-tunnel

Usage

JS — drop-in WebSocket replacement:

import { createSocket } from "jupyter-ws-tunnel";

// pass a widget model to tunnel over its comm; omit it for a real WebSocket
const socket = createSocket("/my-route", model);
socket.onmessage = (event) => console.log(event.data);

Python — attach an existing ASGI app's websocket route to a widget's comm:

from jupyter_ws_tunnel import attach_widget

attach_widget(widget, app)  # app is any ASGI3 app already being served

See example/ for a full working demo (a Quart app served both ways at once).

License

MIT

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

jupyter_ws_tunnel-0.1.3.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyter_ws_tunnel-0.1.3-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file jupyter_ws_tunnel-0.1.3.tar.gz.

File metadata

  • Download URL: jupyter_ws_tunnel-0.1.3.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jupyter_ws_tunnel-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6bb17cee91a48cfdbf67b884e9b75e5362e1aa6c05e7bb8fda224c0cab19167f
MD5 5134e879332fdf47f7f31374481909c9
BLAKE2b-256 4fc869d472ea82d0bb7240c5fc21ba90a54935b268fd2d11854fb8efe929ccc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_ws_tunnel-0.1.3.tar.gz:

Publisher: publish-pypi.yml on hexane360/jupyter-ws-tunnel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jupyter_ws_tunnel-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_ws_tunnel-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1f0be94809b516da7cbfd7002efabb7770e74ba589e5ed99883a4dcbd3b91a94
MD5 04a365f444bf62178afde183c8b4e462
BLAKE2b-256 9361747076eb44154b30d78d1e56e2f6bea9f7ec611717eb36a45bdcaffe81ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_ws_tunnel-0.1.3-py3-none-any.whl:

Publisher: publish-pypi.yml on hexane360/jupyter-ws-tunnel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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