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

Uploaded Python 3

File details

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

File metadata

  • Download URL: jupyter_ws_tunnel-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 7cdab87214a0890c5cfb03c965a33377049093c127398f4f3df426cd39999904
MD5 a18278c6de325610aec4940aa9a4ec01
BLAKE2b-256 2ed47b05801d0ad043789b3b2e518e956324cfe38b27dc2b0974710dbb2defaa

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jupyter_ws_tunnel-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af82c70bf2c71e060749de8579052313c19213bc1ce06b3574e8474345f0d062
MD5 29b8b0d64ad17af5a4ecd3154cfc1f13
BLAKE2b-256 f0d461d2df19c07a75f4735bc0f256d386b04f7815609f7d0bbf1b733e5af0ef

See more details on using hashes here.

Provenance

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