| name | notebook-helpers |
| description | Reference for notebook manipulation scripts (notebook_helpers.py, notebook_tools.py). Use when working with Jupyter notebooks, analyzing structure, executing cells, or manipulating notebook content. |
Notebook Helper Scripts Reference
notebook_helpers.py - Low-level notebook manipulation
Python API
from scripts.notebook_helpers import NotebookHelper, CellIterator, NotebookExecutor
helper = NotebookHelper("path/to/notebook.ipynb")
helper.list_cells()
helper.get_cell_source(5)
helper.set_cell_source(5, "new code")
helper.find_cells_with_pattern("import")
helper.find_cells_with_errors()
helper.find_consecutive_code_cells()
helper.save()
iterator = CellIterator(
notebook_path="notebook.ipynb",
cell_index=5,
objective="Output should contain 'SUCCESS'",
max_iterations=5
)
CLI Usage
python scripts/notebook_tools/notebook_helpers.py list notebook.ipynb --verbose
python scripts/notebook_tools/notebook_helpers.py execute notebook.ipynb --cell 5 --timeout 60
python scripts/notebook_tools/notebook_helpers.py execute notebook.ipynb --verbose
python scripts/notebook_tools/notebook_helpers.py detect-kernel notebook.ipynb
python scripts/notebook_tools/notebook_helpers.py get-source notebook.ipynb 5
python scripts/notebook_tools/notebook_helpers.py get-output notebook.ipynb 5
notebook_tools.py - High-level CLI
python scripts/notebook_tools/notebook_tools.py validate Sudoku --quick
python scripts/notebook_tools/notebook_tools.py validate MyIA.AI.Notebooks/Sudoku/Sudoku-1.ipynb
python scripts/notebook_tools/notebook_tools.py skeleton MyIA.AI.Notebooks/Tweety --output markdown
python scripts/notebook_tools/notebook_tools.py analyze MyIA.AI.Notebooks/SymbolicAI
python scripts/notebook_tools/notebook_tools.py check-env Lean
python scripts/notebook_tools/notebook_tools.py execute GameTheory --timeout 120 --cell-by-cell
extract_notebook_skeleton.py
python scripts/notebook_tools/extract_notebook_skeleton.py MyIA.AI.Notebooks/Sudoku
python scripts/notebook_tools/extract_notebook_skeleton.py MyIA.AI.Notebooks/Sudoku --output markdown
python scripts/notebook_tools/extract_notebook_skeleton.py MyIA.AI.Notebooks/Sudoku --output detailed --code-preview
python scripts/notebook_tools/extract_notebook_skeleton.py MyIA.AI.Notebooks/Sudoku --output json
GenAI-specific scripts (scripts/genai-stack/)
| Script | Description |
|---|
validate_stack.py | Full ComfyUI stack validation |
validate_notebooks.py | Papermill execution of GenAI notebooks |
check_vram.py | GPU/VRAM availability check |
list_models.py | List available ComfyUI models |
list_nodes.py | List ComfyUI nodes |
docker_manager.py | Docker service management |
Key Patterns
- Always use these scripts rather than ad-hoc Python for notebook manipulation
notebook_helpers.py list is the fastest way to understand a notebook's structure
notebook_tools.py validate --quick for rapid structural validation
- For GenAI notebooks, always run
validate_stack.py first