Description¶
Checks if a Jupyter Notebook file (.ipynb) had all its code cells executed in sequential order. Verifies that execution counts are consecutive, which confirms reproducibility and proper notebook execution workflow.
Usage¶
python tools/check_ipynb_order.py <notebook-file>Arguments¶
notebook-file (required) - Path to the .ipynb file to check
Example¶
python tools/check_ipynb_order.py analysis.ipynb
python tools/check_ipynb_order.py notebooks/data_exploration.ipynbOutput¶
The script outputs formatted Markdown with one of the following results:
✅ Success - All code cells were executed in sequential order
⚠️ Warning - One or more code cells were not executed
❌ Out of Order - Execution counts indicate cells were run out of sequence
✅ No Code - Notebook contains no executable code cells
❌ Error - File not found or JSON parsing failed
Example Output¶
### ✅ Success!
> All **25** code cells in `analysis.ipynb` were run in sequential order.Use Cases¶
Verify notebooks were executed top-to-bottom before submission
Check reproducibility of notebook-based analyses
Validate notebooks as part of automated verification pipelines
Requirements¶
Python >= 3.6
Standard library only (no external dependencies)
Technical Details¶
The script:
Parses the notebook JSON structure
Extracts all code cells
Verifies each cell’s
execution_countis sequential (1, 2, 3, ...)Reports any gaps, missing executions, or out-of-order execution