Skip to main content

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 Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_tool_jupytergetiopubmessage


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}/channels via websocket.
  • Returns a dict containing captured stdout, stderr, logs, execution_results, and a timeout_exceeded flag.
  • Built on jupyter_client with Swarmauri tool registration.

Prerequisites

  • Python 3.10 or newer.
  • jupyter_client, websocket-client installed (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 timeout for 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

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

File details

Details for the file swarmauri_tool_jupytergetiopubmessage-0.9.0.dev2.tar.gz.

File metadata

  • Download URL: swarmauri_tool_jupytergetiopubmessage-0.9.0.dev2.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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_jupytergetiopubmessage-0.9.0.dev2.tar.gz
Algorithm Hash digest
SHA256 0e1133ae53dcfab14c8c1205b7d997cc6fab871b972d9e4738813ea33c07fe08
MD5 75c053d26a17292e8fb40038f9216d2c
BLAKE2b-256 6c1483f0e7cdb54452656eace276500edbb1f3fa7b85b17a1fa08452b5025ea5

See more details on using hashes here.

File details

Details for the file swarmauri_tool_jupytergetiopubmessage-0.9.0.dev2-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_tool_jupytergetiopubmessage-0.9.0.dev2-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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_jupytergetiopubmessage-0.9.0.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 c8872fea3760c3d8b05931a1dacc780661a5cd0a734716fc6d6914102ad5de68
MD5 0863cef2f3454231e4bf1a467123e965
BLAKE2b-256 54354bf5e39312820a81aa1caa61c9fa50978f801a032e0f94f02d341b22acdc

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