A tool that reads a Jupyter Notebook file using nbformat, converting the JSON file into a NotebookNode object.
Project description
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_versionargument 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
errorkey 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmauri_tool_jupyterreadnotebook-0.8.3.dev5.tar.gz.
File metadata
- Download URL: swarmauri_tool_jupyterreadnotebook-0.8.3.dev5.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb2e2106e5429e72441edcef5289c534005af0bdaa6c71a8d1cea574cd3a7953
|
|
| MD5 |
de492368b18d53212565ac42fa9a38a7
|
|
| BLAKE2b-256 |
fdec5b91da7e14f03a9f90364ee63ccc4484d019baf4a97382552ea0e034e818
|
File details
Details for the file swarmauri_tool_jupyterreadnotebook-0.8.3.dev5-py3-none-any.whl.
File metadata
- Download URL: swarmauri_tool_jupyterreadnotebook-0.8.3.dev5-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
386e7247b1a73b293d3a949ddea50107cdc51cfc47f12b35126e327ba7d855e1
|
|
| MD5 |
7d100b152a1cf4980ae6c3b1e198c90d
|
|
| BLAKE2b-256 |
77870bab2062d97dcefe18d44e4e87d25ff5c43b6b497a0bd18c786ecfafa7d9
|