notebook-helpers
Skill17 starsChanged yesterdayMITView on GitHub
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.
In this repository19 other files it gives its agents.
- .vibe/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adjoint-secretarySkill
- analyze-slidesSkill
- build-notebookSkill
- check-cell-orderSkill
- cleanup-notebooksSkill
- coordinate-adjointSkill
- coordinateSkill
- enrich-notebooksSkill
- execute-notebookSkill
- genai-iterateSkill
- mcp-jupyterSkill
- notebook-patternsSkill
- qc-iterative-improveSkill
- review-student-prsSkill
- train-modelSkill
- validate-genaiSkill
- verify-notebooksSkill
The file
Files
Notebook Helper Scripts Reference
notebook_helpers.py - Low-level notebook manipulation
Python API
from scripts.notebook_helpers import NotebookHelper, CellIterator, NotebookExecutor
# Read and analyze
helper = NotebookHelper("path/to/notebook.ipynb")
helper.list_cells() # List all cells with type, preview
helper.get_cell_source(5) # Source code of cell 5
helper.set_cell_source(5, "new code") # Modify cell content
helper.find_cells_with_pattern("import") # Search by regex
helper.find_cells_with_errors() # Cells with error outputs
helper.find_consecutive_code_cells() # Code cells without markdown between
helper.save() # Save modifications
# Iterative correction
iterator = CellIterator(
notebook_path="notebook.ipynb",
cell_index=5,
objective="Output should contain 'SUCCESS'",
max_iterations=5
)CLI Usage
# List cells (verbose shows source preview)
python scripts/notebook_tools/notebook_helpers.py list notebook.ipynb --verbose
# Execute a specific cell
python scripts/notebook_tools/notebook_helpers.py execute notebook.ipynb --cell 5 --timeout 60
# Execute entire notebook cell-by-cell
python scripts/notebook_tools/notebook_helpers.py execute notebook.ipynb --verbose
# Detect kernel type
python scripts/notebook_tools/notebook_helpers.py detect-kernel notebook.ipynb
# Get cell source or output
python scripts/notebook_tools/notebook_helpers.py get-source notebook.ipynb 5
python scripts/notebook_tools/notebook_helpers.py get-output notebook.ipynb 5notebook_tools.py - High-level CLI
# Validate structure (quick) or full (with execution)
python scripts/notebook_tools/notebook_tools.py validate Sudoku --quick
python scripts/notebook_tools/notebook_tools.py validate MyIA.AI.Notebooks/Sudoku/Sudoku-01-Backtracking-Python.ipynb
# Extract skeleton for README generation
python scripts/notebook_tools/notebook_tools.py skeleton MyIA.AI.Notebooks/Tweety --output markdown
# Analyze notebook structure
python scripts/notebook_tools/notebook_tools.py analyze MyIA.AI.Notebooks/SymbolicAI
# Check environment requirements
python scripts/notebook_tools/notebook_tools.py check-env Lean
# Execute notebook
python scripts/notebook_tools/notebook_tools.py execute GameTheory --timeout 120 --cell-by-cellextract_notebook_skeleton.py
# Quick summary
python scripts/notebook_tools/extract_notebook_skeleton.py MyIA.AI.Notebooks/Sudoku
# Markdown table for README
python scripts/notebook_tools/extract_notebook_skeleton.py MyIA.AI.Notebooks/Sudoku --output markdown
# Detailed with code previews
python scripts/notebook_tools/extract_notebook_skeleton.py MyIA.AI.Notebooks/Sudoku --output detailed --code-preview
# JSON for programmatic use
python scripts/notebook_tools/extract_notebook_skeleton.py MyIA.AI.Notebooks/Sudoku --output jsonGenAI-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 listis the fastest way to understand a notebook's structurenotebook_tools.py validate --quickfor rapid structural validation- For GenAI notebooks, always run
validate_stack.pyfirst
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

