Skip to main content

A tool designed to execute a single code cell in an IPython interactive shell, mimicking notebook cell execution.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_tool_jupyterruncell


Swarmauri Tool Jupyter Run Cell

Executes a code string inside the current IPython kernel and captures stdout/stderr/error text.

Features

  • Runs arbitrary Python snippets with optional timeout.
  • Returns success, cell_output, and error_output keys.
  • Designed for use inside running notebooks or IPython sessions.

Prerequisites

  • Python 3.10 or newer.
  • Running within IPython/Jupyter environment.

Installation

# pip
pip install swarmauri_tool_jupyterruncell

# poetry
poetry add swarmauri_tool_jupyterruncell

# uv (pyproject-based projects)
uv add swarmauri_tool_jupyterruncell

Quickstart

from swarmauri_tool_jupyterruncell import JupyterRunCellTool

runner = JupyterRunCellTool()
result = runner(code="print('Hello from Swarmauri!')", timeout=5)

if result["success"]:
    print("stdout:", result["cell_output"])
else:
    print("error:", result["error_output"])

Tips

  • Set timeout=0 (or omit) to disable execution timeouts.
  • Capture error_output to diagnose exceptions raised by the executed code.
  • Use alongside other notebook automation tools (execute, export, etc.) to build richer pipelines.

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

swarmauri_tool_jupyterruncell-0.9.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

swarmauri_tool_jupyterruncell-0.9.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file swarmauri_tool_jupyterruncell-0.9.0.tar.gz.

File metadata

  • Download URL: swarmauri_tool_jupyterruncell-0.9.0.tar.gz
  • Upload date:
  • Size: 8.4 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_jupyterruncell-0.9.0.tar.gz
Algorithm Hash digest
SHA256 9b77527d3a7bfc96d70c8f5abd442f2faff3f9ec5d4eb1ea2c2d6b43238d9e4f
MD5 36cea3ce11791cc2cf871d5ab1a939e9
BLAKE2b-256 5c6d9169e31be1a0eac8d769dbdeb5b714fa9f76feca38c76b4220b19b464af2

See more details on using hashes here.

File details

Details for the file swarmauri_tool_jupyterruncell-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_tool_jupyterruncell-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 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_jupyterruncell-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2458743629cb78cd2774a2d352eff0602eac9679f1f6608d5f0d14a68a18e8b
MD5 7ac9dc6af87d96105c019fa65c55f1cb
BLAKE2b-256 b33b7247b00568d311811924349ac9b2abdf7706cb23b3e468f120adccf38433

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