swarmauri_tool_jupyterstartkernel 0.9.0.dev4__tar.gz → 0.9.0.dev21__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- swarmauri_tool_jupyterstartkernel-0.9.0.dev21/PKG-INFO +182 -0
- swarmauri_tool_jupyterstartkernel-0.9.0.dev21/README.md +155 -0
- {swarmauri_tool_jupyterstartkernel-0.9.0.dev4 → swarmauri_tool_jupyterstartkernel-0.9.0.dev21}/pyproject.toml +21 -1
- swarmauri_tool_jupyterstartkernel-0.9.0.dev4/PKG-INFO +0 -130
- swarmauri_tool_jupyterstartkernel-0.9.0.dev4/README.md +0 -109
- {swarmauri_tool_jupyterstartkernel-0.9.0.dev4 → swarmauri_tool_jupyterstartkernel-0.9.0.dev21}/LICENSE +0 -0
- {swarmauri_tool_jupyterstartkernel-0.9.0.dev4 → swarmauri_tool_jupyterstartkernel-0.9.0.dev21}/swarmauri_tool_jupyterstartkernel/JupyterStartKernelTool.py +0 -0
- {swarmauri_tool_jupyterstartkernel-0.9.0.dev4 → swarmauri_tool_jupyterstartkernel-0.9.0.dev21}/swarmauri_tool_jupyterstartkernel/__init__.py +0 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: swarmauri_tool_jupyterstartkernel
|
|
3
|
+
Version: 0.9.0.dev21
|
|
4
|
+
Summary: A tool designed to start a new Jupyter kernel programmatically using jupyter_client, enabling execution of notebook cells.
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: swarmauri,tool,jupyterstartkernel,designed,start,new,jupyter,kernel,programmatically,client,enabling,execution,notebook,cells
|
|
8
|
+
Author: Jacob Stewart
|
|
9
|
+
Author-email: jacob@swarmauri.com
|
|
10
|
+
Requires-Python: >=3.10,<3.13
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Natural Language :: English
|
|
17
|
+
Classifier: Development Status :: 3 - Alpha
|
|
18
|
+
Classifier: Intended Audience :: Developers
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
20
|
+
Requires-Dist: ipykernel (>=6.29.5)
|
|
21
|
+
Requires-Dist: jupyter_client (>=8.6.3)
|
|
22
|
+
Requires-Dist: swarmauri_base
|
|
23
|
+
Requires-Dist: swarmauri_core
|
|
24
|
+
Requires-Dist: swarmauri_standard
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
<p align="center">
|
|
30
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
31
|
+
<img src="https://img.shields.io/pypi/dm/swarmauri_tool_jupyterstartkernel" alt="PyPI - Downloads"/></a>
|
|
32
|
+
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupyterstartkernel/">
|
|
33
|
+
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupyterstartkernel.svg"/></a>
|
|
34
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
35
|
+
<img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_jupyterstartkernel" alt="PyPI - Python Version"/></a>
|
|
36
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
37
|
+
<img src="https://img.shields.io/pypi/l/swarmauri_tool_jupyterstartkernel" alt="PyPI - License"/></a>
|
|
38
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
39
|
+
<img src="https://img.shields.io/pypi/v/swarmauri_tool_jupyterstartkernel?label=swarmauri_tool_jupyterstartkernel&color=green" alt="PyPI - swarmauri_tool_jupyterstartkernel"/></a>
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
# Swarmauri Tool · Jupyter Start Kernel
|
|
45
|
+
|
|
46
|
+
A Swarmauri orchestration tool that spins up Jupyter kernels on demand using `jupyter_client`. The helper wraps connection-file management, kernel specification, and timeout handling so automation pipelines, notebook CI, or Swarmauri agents can acquire fresh kernels with one function call.
|
|
47
|
+
|
|
48
|
+
- Launches kernels with configurable names and kernel-spec overrides.
|
|
49
|
+
- Surfaces ready-to-use connection metadata for downstream orchestration.
|
|
50
|
+
- Keeps a reference to the underlying `KernelManager` so you can interact with the kernel lifecycle after launch.
|
|
51
|
+
|
|
52
|
+
## Requirements
|
|
53
|
+
|
|
54
|
+
- Python 3.10 – 3.13.
|
|
55
|
+
- The environment must have Jupyter kernel specs installed (for example the default `python3`).
|
|
56
|
+
- Dependencies (`jupyter_client`, `swarmauri_base`, `swarmauri_standard`, `pydantic`) install automatically.
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
|
|
60
|
+
Install via the packaging tool that matches your workflow. Each command fetches transitive dependencies.
|
|
61
|
+
|
|
62
|
+
**pip**
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install swarmauri_tool_jupyterstartkernel
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Poetry**
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
poetry add swarmauri_tool_jupyterstartkernel
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**uv**
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Add to the current project and update uv.lock
|
|
78
|
+
uv add swarmauri_tool_jupyterstartkernel
|
|
79
|
+
|
|
80
|
+
# or install into the active environment without touching pyproject.toml
|
|
81
|
+
uv pip install swarmauri_tool_jupyterstartkernel
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
> Tip: When using uv inside this repository, run commands from the repository root so `uv` can resolve the shared `pyproject.toml`.
|
|
85
|
+
|
|
86
|
+
## Quick Start
|
|
87
|
+
|
|
88
|
+
The tool behaves like a callable. Instantiate it and optionally pass a `kernel_name`, timeout, or kernel spec.
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
from swarmauri_tool_jupyterstartkernel import JupyterStartKernelTool
|
|
92
|
+
|
|
93
|
+
start_kernel = JupyterStartKernelTool()
|
|
94
|
+
result = start_kernel() # defaults to python3
|
|
95
|
+
|
|
96
|
+
print(result)
|
|
97
|
+
# {
|
|
98
|
+
# 'status': 'success',
|
|
99
|
+
# 'kernel_id': '03c7d8f9-ec4d-4a8a-8a90-cdb35ff9e6c9',
|
|
100
|
+
# 'kernel_name': 'python3',
|
|
101
|
+
# 'connection_file': '/Users/.../jupyter/runtime/kernel-03c7d8f9.json'
|
|
102
|
+
# }
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
A non-success status signals the kernel failed to spawn (missing kernelspec, permission issue, etc.).
|
|
106
|
+
|
|
107
|
+
## Usage Scenarios
|
|
108
|
+
|
|
109
|
+
### Launch With Custom Specification
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
from swarmauri_tool_jupyterstartkernel import JupyterStartKernelTool
|
|
113
|
+
|
|
114
|
+
start_kernel = JupyterStartKernelTool()
|
|
115
|
+
config = {
|
|
116
|
+
"env": {"EXPERIMENT_FLAG": "1"},
|
|
117
|
+
"resource_limits": {"memory": "1G"}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
custom = start_kernel(kernel_name="python3", kernel_spec=config, startup_timeout=20)
|
|
121
|
+
|
|
122
|
+
if custom["status"] == "success":
|
|
123
|
+
print(f"Kernel ready at {custom['connection_file']}")
|
|
124
|
+
else:
|
|
125
|
+
raise RuntimeError(custom["message"])
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Pass a `kernel_spec` dict to tweak environment variables or other launch parameters that the underlying `KernelManager` accepts.
|
|
129
|
+
|
|
130
|
+
### Pair With the Shutdown Tool in an Automated Flow
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
from swarmauri_tool_jupyterstartkernel import JupyterStartKernelTool
|
|
134
|
+
from swarmauri_tool_jupytershutdownkernel import JupyterShutdownKernelTool
|
|
135
|
+
|
|
136
|
+
start_kernel = JupyterStartKernelTool()
|
|
137
|
+
shutdown_kernel = JupyterShutdownKernelTool()
|
|
138
|
+
|
|
139
|
+
launch = start_kernel(kernel_name="python3")
|
|
140
|
+
if launch["status"] != "success":
|
|
141
|
+
raise RuntimeError(launch["message"])
|
|
142
|
+
|
|
143
|
+
kernel_id = launch["kernel_id"]
|
|
144
|
+
print(f"Kernel started: {kernel_id}")
|
|
145
|
+
|
|
146
|
+
# ... run your notebook execution workflow ...
|
|
147
|
+
|
|
148
|
+
cleanup = shutdown_kernel(kernel_id=kernel_id, shutdown_timeout=10)
|
|
149
|
+
print(cleanup)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Use this pairing in CI pipelines or agent flows that must guarantee kernels are torn down after execution.
|
|
153
|
+
|
|
154
|
+
### Integrate Inside a Swarmauri Agent
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
from swarmauri_core.agent.Agent import Agent
|
|
158
|
+
from swarmauri_core.messages.HumanMessage import HumanMessage
|
|
159
|
+
from swarmauri_standard.tools.registry import ToolRegistry
|
|
160
|
+
from swarmauri_tool_jupyterstartkernel import JupyterStartKernelTool
|
|
161
|
+
|
|
162
|
+
registry = ToolRegistry()
|
|
163
|
+
registry.register(JupyterStartKernelTool())
|
|
164
|
+
|
|
165
|
+
agent = Agent(tool_registry=registry)
|
|
166
|
+
message = HumanMessage(content="start a python3 kernel for my notebook batch job")
|
|
167
|
+
response = agent.run(message)
|
|
168
|
+
print(response)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The agent resolves the registered tool, starts a kernel, and returns the connection metadata to the conversation context.
|
|
172
|
+
|
|
173
|
+
## Troubleshooting
|
|
174
|
+
|
|
175
|
+
- **`No such kernel`** – The requested `kernel_name` is not installed. Check `jupyter kernelspec list`.
|
|
176
|
+
- **`Kernel start timeout exceeded`** – Increase `startup_timeout` for slow environments or pre-warm interpreters.
|
|
177
|
+
- **Permission errors** – Ensure the process can create files inside Jupyter's runtime directory (usually `~/.local/share/jupyter/runtime`).
|
|
178
|
+
|
|
179
|
+
## License
|
|
180
|
+
|
|
181
|
+
`swarmauri_tool_jupyterstartkernel` is released under the Apache 2.0 License. See `LICENSE` for details.
|
|
182
|
+
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
5
|
+
<img src="https://img.shields.io/pypi/dm/swarmauri_tool_jupyterstartkernel" alt="PyPI - Downloads"/></a>
|
|
6
|
+
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupyterstartkernel/">
|
|
7
|
+
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupyterstartkernel.svg"/></a>
|
|
8
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
9
|
+
<img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_jupyterstartkernel" alt="PyPI - Python Version"/></a>
|
|
10
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
11
|
+
<img src="https://img.shields.io/pypi/l/swarmauri_tool_jupyterstartkernel" alt="PyPI - License"/></a>
|
|
12
|
+
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
13
|
+
<img src="https://img.shields.io/pypi/v/swarmauri_tool_jupyterstartkernel?label=swarmauri_tool_jupyterstartkernel&color=green" alt="PyPI - swarmauri_tool_jupyterstartkernel"/></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Swarmauri Tool · Jupyter Start Kernel
|
|
19
|
+
|
|
20
|
+
A Swarmauri orchestration tool that spins up Jupyter kernels on demand using `jupyter_client`. The helper wraps connection-file management, kernel specification, and timeout handling so automation pipelines, notebook CI, or Swarmauri agents can acquire fresh kernels with one function call.
|
|
21
|
+
|
|
22
|
+
- Launches kernels with configurable names and kernel-spec overrides.
|
|
23
|
+
- Surfaces ready-to-use connection metadata for downstream orchestration.
|
|
24
|
+
- Keeps a reference to the underlying `KernelManager` so you can interact with the kernel lifecycle after launch.
|
|
25
|
+
|
|
26
|
+
## Requirements
|
|
27
|
+
|
|
28
|
+
- Python 3.10 – 3.13.
|
|
29
|
+
- The environment must have Jupyter kernel specs installed (for example the default `python3`).
|
|
30
|
+
- Dependencies (`jupyter_client`, `swarmauri_base`, `swarmauri_standard`, `pydantic`) install automatically.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
Install via the packaging tool that matches your workflow. Each command fetches transitive dependencies.
|
|
35
|
+
|
|
36
|
+
**pip**
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install swarmauri_tool_jupyterstartkernel
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Poetry**
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
poetry add swarmauri_tool_jupyterstartkernel
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**uv**
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Add to the current project and update uv.lock
|
|
52
|
+
uv add swarmauri_tool_jupyterstartkernel
|
|
53
|
+
|
|
54
|
+
# or install into the active environment without touching pyproject.toml
|
|
55
|
+
uv pip install swarmauri_tool_jupyterstartkernel
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
> Tip: When using uv inside this repository, run commands from the repository root so `uv` can resolve the shared `pyproject.toml`.
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
The tool behaves like a callable. Instantiate it and optionally pass a `kernel_name`, timeout, or kernel spec.
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from swarmauri_tool_jupyterstartkernel import JupyterStartKernelTool
|
|
66
|
+
|
|
67
|
+
start_kernel = JupyterStartKernelTool()
|
|
68
|
+
result = start_kernel() # defaults to python3
|
|
69
|
+
|
|
70
|
+
print(result)
|
|
71
|
+
# {
|
|
72
|
+
# 'status': 'success',
|
|
73
|
+
# 'kernel_id': '03c7d8f9-ec4d-4a8a-8a90-cdb35ff9e6c9',
|
|
74
|
+
# 'kernel_name': 'python3',
|
|
75
|
+
# 'connection_file': '/Users/.../jupyter/runtime/kernel-03c7d8f9.json'
|
|
76
|
+
# }
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
A non-success status signals the kernel failed to spawn (missing kernelspec, permission issue, etc.).
|
|
80
|
+
|
|
81
|
+
## Usage Scenarios
|
|
82
|
+
|
|
83
|
+
### Launch With Custom Specification
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
from swarmauri_tool_jupyterstartkernel import JupyterStartKernelTool
|
|
87
|
+
|
|
88
|
+
start_kernel = JupyterStartKernelTool()
|
|
89
|
+
config = {
|
|
90
|
+
"env": {"EXPERIMENT_FLAG": "1"},
|
|
91
|
+
"resource_limits": {"memory": "1G"}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
custom = start_kernel(kernel_name="python3", kernel_spec=config, startup_timeout=20)
|
|
95
|
+
|
|
96
|
+
if custom["status"] == "success":
|
|
97
|
+
print(f"Kernel ready at {custom['connection_file']}")
|
|
98
|
+
else:
|
|
99
|
+
raise RuntimeError(custom["message"])
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Pass a `kernel_spec` dict to tweak environment variables or other launch parameters that the underlying `KernelManager` accepts.
|
|
103
|
+
|
|
104
|
+
### Pair With the Shutdown Tool in an Automated Flow
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
from swarmauri_tool_jupyterstartkernel import JupyterStartKernelTool
|
|
108
|
+
from swarmauri_tool_jupytershutdownkernel import JupyterShutdownKernelTool
|
|
109
|
+
|
|
110
|
+
start_kernel = JupyterStartKernelTool()
|
|
111
|
+
shutdown_kernel = JupyterShutdownKernelTool()
|
|
112
|
+
|
|
113
|
+
launch = start_kernel(kernel_name="python3")
|
|
114
|
+
if launch["status"] != "success":
|
|
115
|
+
raise RuntimeError(launch["message"])
|
|
116
|
+
|
|
117
|
+
kernel_id = launch["kernel_id"]
|
|
118
|
+
print(f"Kernel started: {kernel_id}")
|
|
119
|
+
|
|
120
|
+
# ... run your notebook execution workflow ...
|
|
121
|
+
|
|
122
|
+
cleanup = shutdown_kernel(kernel_id=kernel_id, shutdown_timeout=10)
|
|
123
|
+
print(cleanup)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Use this pairing in CI pipelines or agent flows that must guarantee kernels are torn down after execution.
|
|
127
|
+
|
|
128
|
+
### Integrate Inside a Swarmauri Agent
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
from swarmauri_core.agent.Agent import Agent
|
|
132
|
+
from swarmauri_core.messages.HumanMessage import HumanMessage
|
|
133
|
+
from swarmauri_standard.tools.registry import ToolRegistry
|
|
134
|
+
from swarmauri_tool_jupyterstartkernel import JupyterStartKernelTool
|
|
135
|
+
|
|
136
|
+
registry = ToolRegistry()
|
|
137
|
+
registry.register(JupyterStartKernelTool())
|
|
138
|
+
|
|
139
|
+
agent = Agent(tool_registry=registry)
|
|
140
|
+
message = HumanMessage(content="start a python3 kernel for my notebook batch job")
|
|
141
|
+
response = agent.run(message)
|
|
142
|
+
print(response)
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The agent resolves the registered tool, starts a kernel, and returns the connection metadata to the conversation context.
|
|
146
|
+
|
|
147
|
+
## Troubleshooting
|
|
148
|
+
|
|
149
|
+
- **`No such kernel`** – The requested `kernel_name` is not installed. Check `jupyter kernelspec list`.
|
|
150
|
+
- **`Kernel start timeout exceeded`** – Increase `startup_timeout` for slow environments or pre-warm interpreters.
|
|
151
|
+
- **Permission errors** – Ensure the process can create files inside Jupyter's runtime directory (usually `~/.local/share/jupyter/runtime`).
|
|
152
|
+
|
|
153
|
+
## License
|
|
154
|
+
|
|
155
|
+
`swarmauri_tool_jupyterstartkernel` is released under the Apache 2.0 License. See `LICENSE` for details.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "swarmauri_tool_jupyterstartkernel"
|
|
3
|
-
version = "0.9.0.
|
|
3
|
+
version = "0.9.0.dev21"
|
|
4
4
|
description = "A tool designed to start a new Jupyter kernel programmatically using jupyter_client, enabling execution of notebook cells."
|
|
5
5
|
license = "Apache-2.0"
|
|
6
6
|
readme = "README.md"
|
|
@@ -12,6 +12,10 @@ classifiers = [
|
|
|
12
12
|
"Programming Language :: Python :: 3.11",
|
|
13
13
|
"Programming Language :: Python :: 3.12",
|
|
14
14
|
"Programming Language :: Python :: 3.13",
|
|
15
|
+
"Natural Language :: English",
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
15
19
|
]
|
|
16
20
|
authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
|
|
17
21
|
dependencies = [
|
|
@@ -21,6 +25,22 @@ dependencies = [
|
|
|
21
25
|
"swarmauri_base",
|
|
22
26
|
"swarmauri_standard",
|
|
23
27
|
]
|
|
28
|
+
keywords = [
|
|
29
|
+
"swarmauri",
|
|
30
|
+
"tool",
|
|
31
|
+
"jupyterstartkernel",
|
|
32
|
+
"designed",
|
|
33
|
+
"start",
|
|
34
|
+
"new",
|
|
35
|
+
"jupyter",
|
|
36
|
+
"kernel",
|
|
37
|
+
"programmatically",
|
|
38
|
+
"client",
|
|
39
|
+
"enabling",
|
|
40
|
+
"execution",
|
|
41
|
+
"notebook",
|
|
42
|
+
"cells",
|
|
43
|
+
]
|
|
24
44
|
|
|
25
45
|
[tool.uv.sources]
|
|
26
46
|
swarmauri_core = { workspace = true }
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.3
|
|
2
|
-
Name: swarmauri_tool_jupyterstartkernel
|
|
3
|
-
Version: 0.9.0.dev4
|
|
4
|
-
Summary: A tool designed to start a new Jupyter kernel programmatically using jupyter_client, enabling execution of notebook cells.
|
|
5
|
-
License: Apache-2.0
|
|
6
|
-
Author: Jacob Stewart
|
|
7
|
-
Author-email: jacob@swarmauri.com
|
|
8
|
-
Requires-Python: >=3.10,<3.13
|
|
9
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
-
Requires-Dist: ipykernel (>=6.29.5)
|
|
15
|
-
Requires-Dist: jupyter_client (>=8.6.3)
|
|
16
|
-
Requires-Dist: swarmauri_base
|
|
17
|
-
Requires-Dist: swarmauri_core
|
|
18
|
-
Requires-Dist: swarmauri_standard
|
|
19
|
-
Description-Content-Type: text/markdown
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-

|
|
23
|
-
|
|
24
|
-
<p align="center">
|
|
25
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
26
|
-
<img src="https://img.shields.io/pypi/dm/swarmauri_tool_jupyterstartkernel" alt="PyPI - Downloads"/></a>
|
|
27
|
-
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupyterstartkernel/">
|
|
28
|
-
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupyterstartkernel.svg"/></a>
|
|
29
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
30
|
-
<img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_jupyterstartkernel" alt="PyPI - Python Version"/></a>
|
|
31
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
32
|
-
<img src="https://img.shields.io/pypi/l/swarmauri_tool_jupyterstartkernel" alt="PyPI - License"/></a>
|
|
33
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
34
|
-
<img src="https://img.shields.io/pypi/v/swarmauri_tool_jupyterstartkernel?label=swarmauri_tool_jupyterstartkernel&color=green" alt="PyPI - swarmauri_tool_jupyterstartkernel"/></a>
|
|
35
|
-
</p>
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
# Swarmauri Tool Jupyter Start Kernel
|
|
40
|
-
|
|
41
|
-
## Overview
|
|
42
|
-
The swarmauri_tool_jupyterstartkernel package provides a tool that programmatically starts a Jupyter kernel using jupyter_client. It integrates seamlessly with the Swarmauri framework to offer flexible kernel initialization, monitoring, and error handling.
|
|
43
|
-
|
|
44
|
-
This tool can be particularly useful for dynamic, programmatic execution of notebook cells, automated testing of notebook-based workflows, or other situations where a Python (or alternative language) kernel instance is needed on-demand.
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Installation
|
|
49
|
-
You can install this package from the Python Package Index (PyPI). Make sure your Python version is between 3.10 and 3.12 (inclusive of 3.10 and exclusive of 3.13):
|
|
50
|
-
|
|
51
|
-
pip install swarmauri_tool_jupyterstartkernel
|
|
52
|
-
|
|
53
|
-
If your environment uses Poetry, you can add this line to your pyproject.toml under [tool.poetry.dependencies]:
|
|
54
|
-
|
|
55
|
-
swarmauri_tool_jupyterstartkernel = "*"
|
|
56
|
-
|
|
57
|
-
Note that the tool depends on:
|
|
58
|
-
• swarmauri_core
|
|
59
|
-
• swarmauri_base
|
|
60
|
-
• jupyter_client
|
|
61
|
-
|
|
62
|
-
These will be installed automatically when using pip or Poetry.
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Usage
|
|
67
|
-
Once installed, you can import and create an instance of the JupyterStartKernelTool in your Python code. Below is a simple example showing how to start a kernel and capture the resulting kernel name and ID.
|
|
68
|
-
|
|
69
|
-
```python
|
|
70
|
-
from swarmauri_tool_jupyterstartkernel import JupyterStartKernelTool
|
|
71
|
-
|
|
72
|
-
# Create an instance of the JupyterStartKernelTool
|
|
73
|
-
tool = JupyterStartKernelTool()
|
|
74
|
-
|
|
75
|
-
# Start a default python3 kernel
|
|
76
|
-
results = tool()
|
|
77
|
-
print("Default Kernel Results:", results)
|
|
78
|
-
|
|
79
|
-
# Start a different kernel by specifying 'kernel_name'
|
|
80
|
-
custom_results = tool(kernel_name="python3")
|
|
81
|
-
print("Custom Kernel Results:", custom_results)
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### Advanced Usage
|
|
85
|
-
You can optionally provide a kernel specification dictionary to configure more complex settings (e.g., environment variables, resource limits, custom arguments). This example shows how you might pass a simple configuration dictionary:
|
|
86
|
-
|
|
87
|
-
```python
|
|
88
|
-
config_spec = {
|
|
89
|
-
"env": {
|
|
90
|
-
"MY_CUSTOM_ENV_VAR": "test_value"
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
# Start a kernel with custom specification
|
|
95
|
-
results_with_spec = tool(kernel_name="python3", kernel_spec=config_spec)
|
|
96
|
-
print("Advanced Kernel Results with Spec:", results_with_spec)
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
If a kernel fails to start, the tool returns an error message in the dictionary:
|
|
100
|
-
|
|
101
|
-
```python
|
|
102
|
-
error_results = tool(kernel_name="non_existent_kernel")
|
|
103
|
-
if "error" in error_results:
|
|
104
|
-
print("Error starting kernel:", error_results["error"])
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### Retrieving the Kernel Manager
|
|
108
|
-
The JupyterStartKernelTool class stores the KernelManager instance internally for access after a successful start. You can retrieve it at any time using:
|
|
109
|
-
|
|
110
|
-
```python
|
|
111
|
-
km = tool.get_kernel_manager()
|
|
112
|
-
if km:
|
|
113
|
-
print("Kernel Manager is available for further operations.")
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## Dependencies
|
|
119
|
-
• swarmauri_core: Provides the base classes and architecture for Swarmauri-type components.
|
|
120
|
-
• swarmauri_base: Contains the general ToolBase class and other internal utilities.
|
|
121
|
-
• jupyter_client: Manages Jupyter kernel operations, allowing this tool to start and monitor kernels.
|
|
122
|
-
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
## License
|
|
126
|
-
swarmauri_tool_jupyterstartkernel is distributed under the Apache-2.0 License.
|
|
127
|
-
© 2023 Swarmauri. All Rights Reserved.
|
|
128
|
-
|
|
129
|
-
For additional support, feel free to open an issue or contact our team for guidance on leveraging this tool within your Swarmauri-based deployments.
|
|
130
|
-
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-

|
|
3
|
-
|
|
4
|
-
<p align="center">
|
|
5
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
6
|
-
<img src="https://img.shields.io/pypi/dm/swarmauri_tool_jupyterstartkernel" alt="PyPI - Downloads"/></a>
|
|
7
|
-
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupyterstartkernel/">
|
|
8
|
-
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_jupyterstartkernel.svg"/></a>
|
|
9
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
10
|
-
<img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_jupyterstartkernel" alt="PyPI - Python Version"/></a>
|
|
11
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
12
|
-
<img src="https://img.shields.io/pypi/l/swarmauri_tool_jupyterstartkernel" alt="PyPI - License"/></a>
|
|
13
|
-
<a href="https://pypi.org/project/swarmauri_tool_jupyterstartkernel/">
|
|
14
|
-
<img src="https://img.shields.io/pypi/v/swarmauri_tool_jupyterstartkernel?label=swarmauri_tool_jupyterstartkernel&color=green" alt="PyPI - swarmauri_tool_jupyterstartkernel"/></a>
|
|
15
|
-
</p>
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
# Swarmauri Tool Jupyter Start Kernel
|
|
20
|
-
|
|
21
|
-
## Overview
|
|
22
|
-
The swarmauri_tool_jupyterstartkernel package provides a tool that programmatically starts a Jupyter kernel using jupyter_client. It integrates seamlessly with the Swarmauri framework to offer flexible kernel initialization, monitoring, and error handling.
|
|
23
|
-
|
|
24
|
-
This tool can be particularly useful for dynamic, programmatic execution of notebook cells, automated testing of notebook-based workflows, or other situations where a Python (or alternative language) kernel instance is needed on-demand.
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Installation
|
|
29
|
-
You can install this package from the Python Package Index (PyPI). Make sure your Python version is between 3.10 and 3.12 (inclusive of 3.10 and exclusive of 3.13):
|
|
30
|
-
|
|
31
|
-
pip install swarmauri_tool_jupyterstartkernel
|
|
32
|
-
|
|
33
|
-
If your environment uses Poetry, you can add this line to your pyproject.toml under [tool.poetry.dependencies]:
|
|
34
|
-
|
|
35
|
-
swarmauri_tool_jupyterstartkernel = "*"
|
|
36
|
-
|
|
37
|
-
Note that the tool depends on:
|
|
38
|
-
• swarmauri_core
|
|
39
|
-
• swarmauri_base
|
|
40
|
-
• jupyter_client
|
|
41
|
-
|
|
42
|
-
These will be installed automatically when using pip or Poetry.
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Usage
|
|
47
|
-
Once installed, you can import and create an instance of the JupyterStartKernelTool in your Python code. Below is a simple example showing how to start a kernel and capture the resulting kernel name and ID.
|
|
48
|
-
|
|
49
|
-
```python
|
|
50
|
-
from swarmauri_tool_jupyterstartkernel import JupyterStartKernelTool
|
|
51
|
-
|
|
52
|
-
# Create an instance of the JupyterStartKernelTool
|
|
53
|
-
tool = JupyterStartKernelTool()
|
|
54
|
-
|
|
55
|
-
# Start a default python3 kernel
|
|
56
|
-
results = tool()
|
|
57
|
-
print("Default Kernel Results:", results)
|
|
58
|
-
|
|
59
|
-
# Start a different kernel by specifying 'kernel_name'
|
|
60
|
-
custom_results = tool(kernel_name="python3")
|
|
61
|
-
print("Custom Kernel Results:", custom_results)
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Advanced Usage
|
|
65
|
-
You can optionally provide a kernel specification dictionary to configure more complex settings (e.g., environment variables, resource limits, custom arguments). This example shows how you might pass a simple configuration dictionary:
|
|
66
|
-
|
|
67
|
-
```python
|
|
68
|
-
config_spec = {
|
|
69
|
-
"env": {
|
|
70
|
-
"MY_CUSTOM_ENV_VAR": "test_value"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
# Start a kernel with custom specification
|
|
75
|
-
results_with_spec = tool(kernel_name="python3", kernel_spec=config_spec)
|
|
76
|
-
print("Advanced Kernel Results with Spec:", results_with_spec)
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
If a kernel fails to start, the tool returns an error message in the dictionary:
|
|
80
|
-
|
|
81
|
-
```python
|
|
82
|
-
error_results = tool(kernel_name="non_existent_kernel")
|
|
83
|
-
if "error" in error_results:
|
|
84
|
-
print("Error starting kernel:", error_results["error"])
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Retrieving the Kernel Manager
|
|
88
|
-
The JupyterStartKernelTool class stores the KernelManager instance internally for access after a successful start. You can retrieve it at any time using:
|
|
89
|
-
|
|
90
|
-
```python
|
|
91
|
-
km = tool.get_kernel_manager()
|
|
92
|
-
if km:
|
|
93
|
-
print("Kernel Manager is available for further operations.")
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## Dependencies
|
|
99
|
-
• swarmauri_core: Provides the base classes and architecture for Swarmauri-type components.
|
|
100
|
-
• swarmauri_base: Contains the general ToolBase class and other internal utilities.
|
|
101
|
-
• jupyter_client: Manages Jupyter kernel operations, allowing this tool to start and monitor kernels.
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## License
|
|
106
|
-
swarmauri_tool_jupyterstartkernel is distributed under the Apache-2.0 License.
|
|
107
|
-
© 2023 Swarmauri. All Rights Reserved.
|
|
108
|
-
|
|
109
|
-
For additional support, feel free to open an issue or contact our team for guidance on leveraging this tool within your Swarmauri-based deployments.
|
|
File without changes
|
|
File without changes
|