Swarmauri Tool Jupyter From Dict
Creates a validated Jupyter NotebookNode from a Python dictionary using nbformat.
Features
- Validates notebook structure against nbformat schema.
- Returns
{"notebook_node": ...}on success or{"error": ...}when conversion fails. - Useful for programmatically building notebooks before executing/exporting them with other Swarmauri tools.
Prerequisites
- Python 3.10 or newer.
- nbformat installed (pulled automatically).
Installation
# pip
pip install swarmauri_tool_jupyterfromdict
# poetry
poetry add swarmauri_tool_jupyterfromdict
# uv (pyproject-based projects)
uv add swarmauri_tool_jupyterfromdict
Quickstart
import json
from swarmauri_tool_jupyterfromdict import JupyterFromDictTool
notebook_dict = {
"nbformat": 4,
"nbformat_minor": 5,
"metadata": {},
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": ["# Hello World\n", "This is a generated notebook."],
}
],
}
result = JupyterFromDictTool()(notebook_dict)
if "notebook_node" in result:
print("NotebookNode ready", type(result["notebook_node"]))
else:
print("Error:", result["error"])
Tips
- Feed the resulting
NotebookNodedirectly into execution/export tools such asJupyterExecuteNotebookToolor nbconvert exporters. - Use
json.dumps/json.loadsif you need to persist or transmit the notebook dictionary before conversion.
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_jupyterfromdict 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_jupyterfromdict-0.10.0.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swarmauri_tool_jupyterfromdict-0.10.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.6 kB
Release files / swarmauri_tool_jupyterfromdict-0.10.0.tar.gz
| Download URL | swarmauri_tool_jupyterfromdict-0.10.0.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cdb9639309bba414534a30fdb45943eadf8e749ef466105c02a57abc4e5a18e6
|
|
BLAKE2b-256 checksum How to use checksums |
0c5940892ae61f9210e49b8759bd80b2c5f47a80b4110a3c3c448bc148431af6
|
| 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_jupyterfromdict-0.10.0-py3-none-any.whl
| Download URL | swarmauri_tool_jupyterfromdict-0.10.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ac78804e33b98341c2ade7567491e426bdc80133db78ad8d54c01b4ff8364333
|
|
BLAKE2b-256 checksum How to use checksums |
3ca3a93b06428c5943cbd243671f8473d1bd0e080af71bf136ee2b266bea5d36
|
| 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}
|