Skip to main content

Swarmauri notebook-orchestration tool for starting Jupyter kernels programmatically with jupyter_client.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_tool_jupyterstartkernel Discord

Swarmauri Tool Jupyter Start Kernel

swarmauri_tool_jupyterstartkernel is a Swarmauri notebook-orchestration tool for starting a Jupyter kernel programmatically through jupyter_client. It is useful for notebook automation, code-execution workflows, agent-controlled kernel sessions, and CI flows that need a fresh kernel before running cells.

Why Use Swarmauri Tool Jupyter Start Kernel

  • Start isolated Jupyter kernels inside Swarmauri workflows.
  • Acquire a kernel ID programmatically for downstream notebook tooling.
  • Prepare execution environments for cell-running and notebook-conversion tools.
  • Keep kernel lifecycle control behind a reusable Swarmauri tool interface.

FAQ

What inputs does the tool accept?
kernel_name and an optional kernel_spec dictionary.

What does the tool return on success?
A dictionary containing kernel_name and kernel_id.

Does the tool expose the running KernelManager?
Yes. The instance stores the active manager and exposes it through get_kernel_manager().

How are startup failures reported?
The tool returns {"error": ...} if the kernel cannot be started.

Features

  • Swarmauri ToolBase implementation registered as JupyterStartKernelTool.
  • Starts Jupyter kernels by kernel name, defaulting to python3.
  • Stores the active KernelManager for follow-on interactions.
  • Returns simple, orchestration-friendly kernel identity metadata.
  • Supports Python 3.10, 3.11, 3.12, 3.13, and 3.14.

Installation

uv add swarmauri_tool_jupyterstartkernel
pip install swarmauri_tool_jupyterstartkernel

Usage

from swarmauri_tool_jupyterstartkernel import JupyterStartKernelTool

tool = JupyterStartKernelTool()
result = tool(kernel_name="python3")

print(result)

Examples

Start a default Python kernel

from swarmauri_tool_jupyterstartkernel import JupyterStartKernelTool

tool = JupyterStartKernelTool()
result = tool()

print(result["kernel_id"])

Start a kernel and keep the manager reference

from swarmauri_tool_jupyterstartkernel import JupyterStartKernelTool

tool = JupyterStartKernelTool()
result = tool("python3")
manager = tool.get_kernel_manager()

print(result, manager)

Register the tool in a Swarmauri collection

from swarmauri_standard.tools.ToolCollection import ToolCollection
from swarmauri_tool_jupyterstartkernel import JupyterStartKernelTool

tools = ToolCollection(tools=[JupyterStartKernelTool()])
print(tools)

Related Packages

Swarmauri Foundations

More Documentation

Best Practices

  • Ensure the requested kernelspec exists before starting automation flows.
  • Shut down kernels explicitly after use to avoid orphaned processes.
  • Keep per-task kernels isolated when multiple workflows run concurrently.
  • Store the returned kernel ID if other tools need to interact with the same session later.

License

This project is licensed under the Apache-2.0 License.

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_jupyterstartkernel-0.11.0.dev1.tar.gz.

File metadata

  • Download URL: swarmauri_tool_jupyterstartkernel-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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_jupyterstartkernel-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 26316c491f20cf47ab32476b5480df4d6b0045ee3e3d5cb15cca90471fe5f26d
MD5 a5567f872c10bb7ac3d8b797e577eb43
BLAKE2b-256 eeb7a446ee68f75a3c62b4ca58a9ac7d5043d46ff7ebf95359f4063a7f525ab7

See more details on using hashes here.

File details

Details for the file swarmauri_tool_jupyterstartkernel-0.11.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_tool_jupyterstartkernel-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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_jupyterstartkernel-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a7c596026f6b9f97dd85ad47ff3f321aabdb032ea9d3f7b3770094efef71eaa
MD5 e0bab983ab770e39d4419929394bb6ca
BLAKE2b-256 a40ad9c8d7fb0e36c1684d8661d8405ac139bac61bcf92b33128e0c228ae0e7d

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