Skip to main content

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_tool_jupyterfromdict


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 NotebookNode directly into execution/export tools such as JupyterExecuteNotebookTool or nbconvert exporters.
  • Use json.dumps/json.loads if 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)

Source distribution for swarmauri_tool_jupyterfromdict 0.10.0
File Size Uploaded
swarmauri_tool_jupyterfromdict-0.10.0.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for swarmauri_tool_jupyterfromdict 0.10.0
File Interpreter ABI Platform
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}

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page