Skip to main content

A tool designed to retrieve shell messages from a running Jupyter kernel using jupyter_client, useful for debugging execution responses.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_tool_jupytergetshellmessage


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 messages or an error key.
  • 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_client and websocket-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 timeout if 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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file swarmauri_tool_jupytergetshellmessage-0.9.0.dev22.tar.gz.

File metadata

  • Download URL: swarmauri_tool_jupytergetshellmessage-0.9.0.dev22.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","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

Hashes for swarmauri_tool_jupytergetshellmessage-0.9.0.dev22.tar.gz
Algorithm Hash digest
SHA256 4101626650729a7601d516df78b546d7d649bbb944bea6f62323dd8e84b2af2e
MD5 8abe657fb786aa6676023c9cd489f221
BLAKE2b-256 6f8acca225609f91b5a2478619bf3ff69a2f90b1779b7e123172108c9ea5853b

See more details on using hashes here.

File details

Details for the file swarmauri_tool_jupytergetshellmessage-0.9.0.dev22-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_tool_jupytergetshellmessage-0.9.0.dev22-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","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

Hashes for swarmauri_tool_jupytergetshellmessage-0.9.0.dev22-py3-none-any.whl
Algorithm Hash digest
SHA256 07a58cefbea14f5280edd5a6e60e21bfc680dc20bde236f98c468e6fb2732c1d
MD5 f6b7887f279f92b3715c5fc0e892129c
BLAKE2b-256 f7df0a8bd48cf3f64ec0e616ceefc9391b1f07a8bb1be7634c6c56dc3795ea09

See more details on using hashes here.

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