A tool designed to retrieve messages from the IOPub channel of a Jupyter kernel using jupyter_client, capturing cell outputs and logs.
Project description
Swarmauri Tool Jupyter Get IOPub Message
Listens to a Jupyter kernel’s IOPub channel and collects stdout/stderr/log messages for downstream processing.
Features
- Connects to
/api/kernels/{id}/channelsvia websocket. - Returns a dict containing captured
stdout,stderr,logs,execution_results, and atimeout_exceededflag. - Built on
jupyter_clientwith Swarmauri tool registration.
Prerequisites
- Python 3.10 or newer.
jupyter_client,websocket-clientinstalled (pulled automatically).- Access to a running Jupyter kernel (e.g., Notebook server).
Installation
# pip
pip install swarmauri_tool_jupytergetiopubmessage
# poetry
poetry add swarmauri_tool_jupytergetiopubmessage
# uv (pyproject-based projects)
uv add swarmauri_tool_jupytergetiopubmessage
Quickstart
from swarmauri_tool_jupytergetiopubmessage import JupyterGetIOPubMessageTool
channels_url = "ws://localhost:8888/api/kernels/<kernel-id>/channels"
result = JupyterGetIOPubMessageTool()(channels_url, timeout=3.0)
print("stdout:", result["stdout"])
print("stderr:", result["stderr"])
print("logs:", result["logs"])
print("timeout?", result["timeout_exceeded"])
Tips
- Use alongside execution tools to capture live output during automated notebook runs.
- Ensure your environment handles Jupyter tokens/cookies if the server requires authentication.
- Increase
timeoutfor longer-running cells to collect all outputs before returning.
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_jupytergetiopubmessage-0.8.2.dev6.tar.gz.
File metadata
- Download URL: swarmauri_tool_jupytergetiopubmessage-0.8.2.dev6.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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 |
3441ec16a0cb89de98d74f125d09a5c03f073e4736ffbe854d7eb697f69bfec0
|
|
| MD5 |
92134d51850adf87814dfe7ad7adedbc
|
|
| BLAKE2b-256 |
edf0460173154c7a05b06917fe4f18719c06af4d68a0d5c3f7843a3a7cdca9fe
|
File details
Details for the file swarmauri_tool_jupytergetiopubmessage-0.8.2.dev6-py3-none-any.whl.
File metadata
- Download URL: swarmauri_tool_jupytergetiopubmessage-0.8.2.dev6-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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 |
3001860588da153e26972bd4ce1bf6bf038d80574f2fcc9542cefac53dd592ae
|
|
| MD5 |
7b611700288884ddb711829b4b8f0af4
|
|
| BLAKE2b-256 |
18e998311490ccfb212627fe19d296621645df6ef4d7ebb5aec089bfd7127861
|