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

File metadata

  • Download URL: swarmauri_tool_jupyterreadnotebook-0.8.3.dev17.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.dev17.tar.gz
Algorithm Hash digest
SHA256 606a971ddab83e13306b843291e7d3dbfa9bd743dc1e96d86b5256c4af9eb6e6
MD5 c5385a06166968aa3dff9f867d6ddcb7
BLAKE2b-256 4b3a126156f28e637b073d50ebb632ac972a1f5e8663fab44a5b4319eda3ccf7

See more details on using hashes here.

File details

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

File metadata

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

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