Skip to main content

A tool designed to execute parameterized notebooks using papermill, allowing dynamic input and output capture for automated workflows.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_tool_jupyterexecutenotebookwithparameters


Swarmauri Tool Jupyter Execute Notebook With Parameters

Runs a Jupyter notebook with injected parameters using Papermill-style execution.

Features

  • Parameterizes notebooks via Papermill and executes them end-to-end.
  • Saves the executed notebook to an output path of your choice.
  • Returns a dict containing executed_notebook on success or error/message when execution fails.

Prerequisites

  • Python 3.10 or newer.
  • Papermill, nbformat, nbconvert, swarmauri base/core packages (installed automatically).
  • Notebook dependencies must be available in the runtime environment.

Installation

# pip
pip install swarmauri_tool_jupyterexecutenotebookwithparameters

# poetry
poetry add swarmauri_tool_jupyterexecutenotebookwithparameters

# uv (pyproject-based projects)
uv add swarmauri_tool_jupyterexecutenotebookwithparameters

Quickstart

from swarmauri_tool_jupyterexecutenotebookwithparameters import JupyterExecuteNotebookWithParametersTool

executor = JupyterExecuteNotebookWithParametersTool()
response = executor(
    notebook_path="templates/report.ipynb",
    output_notebook_path="outputs/report-filled.ipynb",
    params={
        "input_data_path": "data/input.csv",
        "run_mode": "production",
    },
    timeout=600,
)

if "executed_notebook" in response:
    print("Notebook executed:", response["executed_notebook"])
else:
    print("Error:", response["error"], response.get("message"))

Tips

  • Parameters can be any JSON-serializable values used inside the notebook (strings, numbers, dictionaries, etc.).
  • Increase timeout for notebooks with lengthy cells.
  • Combine with Swarmauri notebook cleaning/conversion tools for full pipelines (execute → clear outputs → convert to PDF/HTML).

Want to help?

If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.

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_jupyterexecutenotebookwithparameters-1.3.2.dev7.tar.gz.

File metadata

  • Download URL: swarmauri_tool_jupyterexecutenotebookwithparameters-1.3.2.dev7.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","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_jupyterexecutenotebookwithparameters-1.3.2.dev7.tar.gz
Algorithm Hash digest
SHA256 70e325f9c7d3b31c92221a8cfd675217f9fc05d2ca0081434b2b72497a85f54c
MD5 600fa4dde0b5d796173d8c7af2ea3b68
BLAKE2b-256 833291f371ffea61fa4ce0a2540e4082762f0a89db5421d33d1991718479a868

See more details on using hashes here.

File details

Details for the file swarmauri_tool_jupyterexecutenotebookwithparameters-1.3.2.dev7-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_tool_jupyterexecutenotebookwithparameters-1.3.2.dev7-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","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_jupyterexecutenotebookwithparameters-1.3.2.dev7-py3-none-any.whl
Algorithm Hash digest
SHA256 2acbb9dae4233b6700e881a574a603be207d4ebaf8780c06324fe9d4e883de05
MD5 7c569c2582b719c1e0794a68c0ac5b65
BLAKE2b-256 394d1ae78d4c1278bfafac4ded675fb168672308f19740187e250d6dbf1d5ace

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