A tool designed to retrieve shell messages from a running Jupyter kernel using jupyter_client, useful for debugging execution responses.
Project description
Swarmauri Tool Jupyter Get Shell Message
A dedicated Python package providing a tool to retrieve shell messages from a running Jupyter kernel using jupyter_client. Built on the swarmauri framework, JupyterGetShellMessageTool is suitable for debugging, logging, and diagnostic purposes.
Installation
To install this package from PyPI, use the following command:
pip install swarmauri_tool_jupytergetshellmessage
If you are using Poetry for dependency management, add it to your project by specifying the package name in your pyproject.toml under [tool.poetry.dependencies]:
[tool.poetry.dependencies]
swarmauri_tool_jupytergetshellmessage = "^0.1.0.dev1"
Once installed, the package automatically brings in its required dependencies:
• swarmauri_core
• swarmauri_base
• jupyter_client
No specialized steps beyond a standard Python environment with pip or Poetry are necessary.
Usage
Below is a simple example illustrating how to retrieve shell messages from a currently running Jupyter kernel. Make sure you have an active Jupyter kernel in the environment you are running this code from (for instance, a notebook server launched via "jupyter notebook" or "jupyter lab").
-
Import JupyterGetShellMessageTool:
from swarmauri_tool_jupytergetshellmessage import JupyterGetShellMessageTool
-
Instantiate the tool and call it:
tool = JupyterGetShellMessageTool() result = tool(timeout=10.0) # Wait up to 10 seconds for shell messages
-
Inspect the result:
if "messages" in result: for msg in result["messages"]: print("Shell Message:", msg) else: print("No messages or error:", result.get("error", "No details"))
The tool attempts to connect to the active Jupyter kernel, retrieve available shell messages, and return them in a structured dictionary. If no messages are found within the specified timeout, it returns an error message indicating the timeout event.
Dependencies
• swarmauri_core and swarmauri_base provide the core classes (ComponentBase, ToolBase) for building and integrating tools across the swarmauri ecosystem.
• jupyter_client is leveraged to interface with the running Jupyter kernel, enabling retrieval of shell-based IPC messages.
These dependencies are automatically installed when installing this package via pip or Poetry.
Contributing
Issues and feature requests for swarmauri_tool_jupytergetshellmessage are always welcome. Although direct repository interaction details are not included here, feel free to suggest improvements or report problems using the relevant issue tracker.
© 2023 Swarmauri. Licensed under the Apache License, Version 2.0.
See the LICENSE file for details.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmauri_tool_jupytergetshellmessage-0.7.5.tar.gz.
File metadata
- Download URL: swarmauri_tool_jupytergetshellmessage-0.7.5.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18c14d721e6830a4f81d001b3ae30c430f8483b770eb661f88c0f298e5d1a41b
|
|
| MD5 |
ba7b92206558942b56942d0f244f538d
|
|
| BLAKE2b-256 |
32e696d838cb78f2b17bad803150f813439a77c5b0596117e81326d9a7f480e5
|
File details
Details for the file swarmauri_tool_jupytergetshellmessage-0.7.5-py3-none-any.whl.
File metadata
- Download URL: swarmauri_tool_jupytergetshellmessage-0.7.5-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac41172d59522240e36afdfd82b95fd5e5241f949e13f753bfa023cb2c04f727
|
|
| MD5 |
fd331e754757465b0768bfee450c989b
|
|
| BLAKE2b-256 |
208157e67e9d24d5519ca76fb9b9c24ddc25029464ee0427263939608a0bdcc9
|