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.dev9.tar.gz.

File metadata

  • Download URL: swarmauri_tool_jupyterreadnotebook-0.8.3.dev9.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.dev9.tar.gz
Algorithm Hash digest
SHA256 afffc5330abb29e083c1b1398643969786dcc92679122a6f506873cd744c9ee8
MD5 da3a163c018a95cf09a216ff9d70131e
BLAKE2b-256 711f317c6accce6debfbf76ac8455f89d395b7c7db6912aecb4006c214542ec7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: swarmauri_tool_jupyterreadnotebook-0.8.3.dev9-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.dev9-py3-none-any.whl
Algorithm Hash digest
SHA256 fa05bcfc0bde12e2be05b641c59153c2693bb984297d97bdc899ece3bb797bae
MD5 ebc4c59276c1368d98608fd2849afcd4
BLAKE2b-256 11a9690117281d24d772635abdd9c21af4b5154763cead1bae7c9cafcde80275

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