Jupyter WebSocket Provider
A Jupyter Server extension that sends the initial file contents to the browser and relays Yjs messages between clients over WebSocket. The browser creates the shared document.
Install from source
You need to have python and npm installed, then enter in a virtual environment:
python -m pip install 'jupyter-builder>=1.2' build
npm install --no-package-lock
npm run build
python -m build
Installation enables the server extension and installs a prebuilt JupyterLab
extension. The JupyterLab extension uses jupyter-docprovider to open shared
documents through /api/collaboration/session/<path> and
/api/collaboration/room/<room-id>.
Run this extension in place of jupyter-server-ydoc, which serves the same routes.
JupyterLab's session endpoint issues an opaque UUID as the file ID for each room lifetime. Clients opening the same path, type, and format share that ID while the room is active.
- The first connection to an empty room receives a JSON text frame with
type: "initialize",path,fileType,format, andcontent. The content is notebook JSON, text, or a base64 string, matching the Jupyter Contents API. Hold the content and send the text frameinitialized. The server confirms with an empty Yjs sync step 2 and admits waiting clients. Apply the content before processing that sync frame. If the socket closes before confirmation, discard the pending content so another client can initialize. - While the room has clients, the server forwards Yjs messages to every other connection in the same room. A joining client sends its Yjs sync step 1, and connected clients answer with their current state. Clients also handle awareness messages.
- JupyterLab sends the current contents and path to
/api/collaboration/save/<room-id>. The server writes a full snapshot through the Contents Manager and returns HTTP 409 if the room has expired or the requested path no longer matches. If several clients save concurrently, the last write determines the disk contents. - Deleting a file through Jupyter Server retires its room and shows an external-change notice in connected tabs. Use Save to original file to restore it, Save As… to choose a destination, or Close tab to close the deleted document. Saves from the retired session are rejected. With a local file Contents Manager, deletions made from the terminal trigger the same notice. When the watcher can identify the same file at a new path inside the Jupyter root, the room follows the move and keeps its file ID.
- With a local file Contents Manager, the server also compares disk content hashes on filesystem changes and before collaborative saves. An external edit retires the room if the hash differs. Use Load from disk to open a fresh room, Save to original file to replace the disk contents with your edits, or Save As… to keep your edits separately.
- When the last client leaves an initialized JupyterLab room, its file ID expires. The next open gets a new ID and starts from disk. A JupyterLab tab reconnecting with the expired ID gets a session-expired dialog and must reopen the document.
The relay also provides the global awareness room for collaboration presence.
To rebuild the prebuilt frontend after editing its source, install the Python
jupyter-builder package, run npm install && npm run build, then reinstall
the Python package.
Tests
With pip 25.1 or newer, install the test dependencies and run pytest from the repository root.
python -m pip install --group test -e .
python -m pytest tests
The integration tests use temporary files and localhost WebSocket connections.
Metadata
Release files for jupyter-websocket-provider 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jupyter_websocket_provider-0.1.1.tar.gz | 19.8 kB | With provenance | Details for jupyter_websocket_provider-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jupyter_websocket_provider-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for jupyter_websocket_provider-0.1.1-py3-none-any.whl |
Total release size: 40.8 kB
Release files / jupyter_websocket_provider-0.1.1.tar.gz
| Download URL | jupyter_websocket_provider-0.1.1.tar.gz |
|---|---|
| Size | 19.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c07f0110ee847a9c2e548cceeb8d61490a6f1405bad8147182f72ddcc105fc9
|
|
BLAKE2b-256 checksum How to use checksums |
43aa2a471e693cf183edade6d899416adcad798e266048144c1849a294e52413
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.
Transparency logRelease files / jupyter_websocket_provider-0.1.1-py3-none-any.whl
| Download URL | jupyter_websocket_provider-0.1.1-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3d550a2cac6c13202f2580edbb8f33ed04e401a1f46cb93d0831ccd22be7cdb1
|
|
BLAKE2b-256 checksum How to use checksums |
8635f1994d886f52675ce529ebe68287254067ad3e5ba4d65c4291e52cac1f85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.
Transparency logSecurity for jupyter-websocket-provider 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for jupyter_websocket_provider-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.