Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

check_ipynb_order.py - Verify Jupyter notebook execution order

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

Example

python tools/check_ipynb_order.py analysis.ipynb
python tools/check_ipynb_order.py notebooks/data_exploration.ipynb

Output

The script outputs formatted Markdown with one of the following results:

Example Output

### ✅ Success!

> All **25** code cells in `analysis.ipynb` were run in sequential order.

Use Cases

Requirements

Technical Details

The script:

  1. Parses the notebook JSON structure

  2. Extracts all code cells

  3. Verifies each cell’s execution_count is sequential (1, 2, 3, ...)

  4. Reports any gaps, missing executions, or out-of-order execution