Skip to main content

A tool that reads a Jupyter Notebook file using nbformat, converting the JSON file into a NotebookNode object.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_tool_jupyterreadnotebook


Swarmauri Tool Jupyter Read Notebook

Reads a .ipynb file from disk into a validated nbformat NotebookNode for downstream processing.

Features

  • Wraps nbformat’s read + validation workflow in a Swarmauri tool.
  • Returns { "notebook_node": NotebookNode } on success or { "error": ... } on failure.
  • Optional as_version argument controls notebook parsing version (default 4).

Prerequisites

  • Python 3.10 or newer.
  • nbformat installed (pulled automatically).

Installation

# pip
pip install swarmauri_tool_jupyterreadnotebook

# poetry
poetry add swarmauri_tool_jupyterreadnotebook

# uv (pyproject-based projects)
uv add swarmauri_tool_jupyterreadnotebook

Quickstart

from swarmauri_tool_jupyterreadnotebook import JupyterReadNotebookTool

reader = JupyterReadNotebookTool()
response = reader(
    notebook_file_path="notebooks/example.ipynb",
    as_version=4,
)

if "notebook_node" in response:
    nb = response["notebook_node"]
    print("Cells:", len(nb.cells))
else:
    print("Error:", response["error"])

Tips

  • Use with execution/export tools to build pipelines (read → execute → convert).
  • Handle error key gracefully when files are missing or malformed.

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_jupyterreadnotebook-0.8.3.dev13.tar.gz.

File metadata

  • Download URL: swarmauri_tool_jupyterreadnotebook-0.8.3.dev13.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","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_jupyterreadnotebook-0.8.3.dev13.tar.gz
Algorithm Hash digest
SHA256 3c1e3a016e98d46b189173d2ca732569f7feab1b69bbb35e9ca097c097bec41d
MD5 ac032d31e8ef2d47cfa993f2f2706c5c
BLAKE2b-256 e71ea2df595759423692ba8fe0cda0084ad2311de785caa4fb9d0bd1dd462cfd

See more details on using hashes here.

File details

Details for the file swarmauri_tool_jupyterreadnotebook-0.8.3.dev13-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_tool_jupyterreadnotebook-0.8.3.dev13-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","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_jupyterreadnotebook-0.8.3.dev13-py3-none-any.whl
Algorithm Hash digest
SHA256 2db91d20bffe0cacb192e2c899961cbf0bec87c0b03298bba3db5ef92cdcef91
MD5 1b43a5f6c8ec437b3f0fb6e01022f587
BLAKE2b-256 890d0b73f41370d3a6d67bb2ecf9c07941360c03cb84bcbfb1b1bd0ff715a021

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