Skip to main content

Swarmauri notebook publishing tool for executing Jupyter notebooks and converting them to rendered output formats.

Project description

Swarmauri Logo

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

Swarmauri Jupyter Execute And Convert Tool

swarmauri_tool_jupyterexecuteandconvert runs a notebook through the jupyter nbconvert CLI, writes an executed notebook artifact, and then converts that executed notebook to a target output format such as HTML or PDF.

Why

  • Execute notebooks and publish rendered artifacts in one Swarmauri tool call.
  • Keep notebook reporting workflows inside a simple automation surface.
  • Produce web or document outputs from the exact executed notebook state.

Features

  • Verifies the source notebook exists before execution.
  • Executes notebooks with jupyter nbconvert --execute.
  • Converts the executed notebook in a second nbconvert step.
  • Supports html and pdf output formats.
  • Returns either {"converted_file": ..., "status": "success"} or an error payload.

FAQ

What file does this tool convert?

It first creates an executed notebook named executed_<original>.ipynb, then converts that executed notebook to the requested format.

Does this return notebook content?

No. It returns metadata about the produced converted file, not the notebook object itself.

When should I use this instead of swarmauri_tool_jupyterexecutenotebook?

Use this package when you want rendered artifacts like HTML or PDF. Use swarmauri_tool_jupyterexecutenotebook when you want the executed NotebookNode in memory.

Installation

uv add swarmauri_tool_jupyterexecuteandconvert
pip install swarmauri_tool_jupyterexecuteandconvert

Usage

from swarmauri_tool_jupyterexecuteandconvert import JupyterExecuteAndConvertTool

tool = JupyterExecuteAndConvertTool()
result = tool(
    notebook_path="reports/weekly.ipynb",
    output_format="html",
    execution_timeout=300,
)

print(result)

Examples

Execute a notebook and export HTML

response = JupyterExecuteAndConvertTool()(
    notebook_path="reports/status.ipynb",
    output_format="html",
    execution_timeout=120,
)

print(response["converted_file"])

Execute a notebook and export PDF

response = JupyterExecuteAndConvertTool()(
    notebook_path="reports/board_packet.ipynb",
    output_format="pdf",
    execution_timeout=600,
)

if "error" in response:
    print(response["message"])

Related Packages

Foundational Swarmauri Packages

More Documentation

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

File metadata

  • Download URL: swarmauri_tool_jupyterexecuteandconvert-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 9.3 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_jupyterexecuteandconvert-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 a3c96704357abdcdd56b9c73420a643306cf61e83762dc487421f9993b147f0a
MD5 ac34e6484eac73487c1e9649bae0e59d
BLAKE2b-256 d5a32eef9a061ad663621e5859a71fb35f4b41b51224b405b9bcb96e0131f33c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: swarmauri_tool_jupyterexecuteandconvert-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 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_jupyterexecuteandconvert-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 a371861cc10e1557cd3ff1f40b6260433d0664ccc422cb1682625daccf6fc3c6
MD5 53c6e87976ecd9eb2c77632e47796bec
BLAKE2b-256 41c6765a4433ce8af8ca7e34fc5ed28cb7be9e47fde4c64c0a2b7f9ddd5f6d2d

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