Swarmauri Tool Jupyter Execute Cell
Executes Python code in the active Jupyter kernel and captures stdout/stderr/errors for downstream tooling.
Features
- Accepts raw code strings and optionally a timeout.
- Returns a dict with
stdout,stderr, anderrorkeys. - Built on
jupyter_clientto talk to the running kernel.
Prerequisites
- Python 3.10 or newer.
- Jupyter kernel running in the environment (IPython/Jupyter installed).
Installation
# pip
pip install swarmauri_tool_jupyterexecutecell
# poetry
poetry add swarmauri_tool_jupyterexecutecell
# uv (pyproject-based projects)
uv add swarmauri_tool_jupyterexecutecell
Quickstart
from swarmauri_tool_jupyterexecutecell import JupyterExecuteCellTool
code = "print('Hello from Swarmauri!')"
result = JupyterExecuteCellTool()(code, timeout=60)
print("stdout:", result["stdout"])
print("stderr:", result["stderr"])
print("error:", result["error"])
Tips
- Increase
timeoutfor cells that perform long-running tasks. - The tool executes in the current kernel—make sure dependencies are already imported/installed in that environment.
- Handle errors gracefully by checking the
errorfield before using results.
Want to help?
If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.
Metadata
Release files for swarmauri_tool_jupyterexecutecell 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swarmauri_tool_jupyterexecutecell-0.10.0.tar.gz | 8.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swarmauri_tool_jupyterexecutecell-0.10.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.7 kB
Release files / swarmauri_tool_jupyterexecutecell-0.10.0.tar.gz
| Download URL | swarmauri_tool_jupyterexecutecell-0.10.0.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e0457ad7ba7018b019c30779fac394c70d56327a856a0f2ccc518f3e162b1f2
|
|
BLAKE2b-256 checksum How to use checksums |
dbf73251f91384d91b2c55dca01ae0fff86d355f9dce504eda0d547c89971429
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","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}
|
Release files / swarmauri_tool_jupyterexecutecell-0.10.0-py3-none-any.whl
| Download URL | swarmauri_tool_jupyterexecutecell-0.10.0-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0c15b34ef770483b0a716b97af722be99746eff4a170c5e83de3ac326d9a2ceb
|
|
BLAKE2b-256 checksum How to use checksums |
5438203db51000d666537e3e2166246415f90da76f523b81f2e3a0b15fcc7e60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","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}
|