A tool designed to retrieve shell messages from a running Jupyter kernel using jupyter_client, useful for debugging execution responses.
Project description
Swarmauri Tool Jupyter Get Shell Message
Retrieves shell-channel messages from a running Jupyter kernel using jupyter_client.
Features
- Listens on the Jupyter kernel shell channel and captures raw message dicts.
- Returns a dict containing
messagesor anerrorkey. - Helpful for debugging live kernel communication during automated notebook workflows.
Prerequisites
- Python 3.10 or newer.
- Access to a running Jupyter kernel (Notebook server, JupyterLab, etc.).
jupyter_clientandwebsocket-client(installed automatically).
Installation
# pip
pip install swarmauri_tool_jupytergetshellmessage
# poetry
poetry add swarmauri_tool_jupytergetshellmessage
# uv (pyproject-based projects)
uv add swarmauri_tool_jupytergetshellmessage
Quickstart
from swarmauri_tool_jupytergetshellmessage import JupyterGetShellMessageTool
channels_url = "ws://localhost:8888/api/kernels/<kernel-id>/channels"
result = JupyterGetIOPubMessageTool()(channels_url, timeout=5.0)
if "messages" in result:
for msg in result["messages"]:
print(msg)
else:
print("Error:", result.get("error"))
Tips
- Ensure you pass the correct kernel channels URL (including security tokens/cookies if your server requires them).
- Increase
timeoutif you expect long-running cells before shell replies are sent. - Combine with notebook execution tools to capture both SHELL and IOPub messages for full observability.
Want to help?
If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmauri_tool_jupytergetshellmessage-0.9.2.tar.gz.
File metadata
- Download URL: swarmauri_tool_jupytergetshellmessage-0.9.2.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62f3569cd1933fdb45376d63b243c8dd5a01a9a5224793e25a17d54efddc40eb
|
|
| MD5 |
3c1fe02e49f4c37196a78ec3b0e5da2d
|
|
| BLAKE2b-256 |
3d8b19d78dedf3fa347b9b57ecdcde22e7c7b3b04a6b8872d0394cee588028d2
|
File details
Details for the file swarmauri_tool_jupytergetshellmessage-0.9.2-py3-none-any.whl.
File metadata
- Download URL: swarmauri_tool_jupytergetshellmessage-0.9.2-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74037a7eaeb6fbdc0e5f1d08d3f88165c4f1bc265a6c211142779d9f40ec9adf
|
|
| MD5 |
d15296735aeac0e18d80de8e8efa21dd
|
|
| BLAKE2b-256 |
94118f1d373e53251871861be763037cc92f82dacf4b5955e1d5c52b0052f205
|