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.2.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.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jupyter_ws_tunnel-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 eec3144b969ca00e63db89dcb6bc905329993a242aa945c0d3f5cacc77837bdf
MD5 fa98792e7eb8130974c74d88b780883b
BLAKE2b-256 60bf83859e7d9cbfc5f50894705dd91cd30728e27c4d8a454a0141687f4b7e2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_ws_tunnel-0.1.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_ws_tunnel-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 74e3594ceb90ee9e90f7cff5a98459226ee26fe74c929f9f5248c057bb155271
MD5 8319cfbcdde9dbab450db24a1e61f2db
BLAKE2b-256 cf3e980d2fcc1a690d7f6f02bdf5a81e6b882c8ede2fe8cf3cc731c85c493a74

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_ws_tunnel-0.1.2-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