This tool scans through all Jupyter notebooks in a specified directory, extracts URLs from markdown and code cells, and checks if the extracted links are valid or broken.
- Recursively finds all Jupyter notebooks in a project directory and extracts links from both markdown and code cells in each notebook
- Validates if the extracted links are valid or broken i.e. 404, 5xx, etc.
- Generates a detailed markdown report of broken links along with the cell number and line number in the notebook where the link is located.
- Install uv (if not already installed):
pip install uv
- Clone the repository and set up the environment:
git clone https://github.com/iamarunbrahma/nb-link-checker.git
cd nb-link-checker
uv venv
source .venv/bin/activate # On Unix/macOS
.venv\Scripts\activate # On Windows
- Install dependencies:
uv pip install -r requirements.txt
uv pip install -r requirements-dev.txt # For development
Basic usage with default settings:
python nb_link_checker.py
Specify a custom project directory and output file:
python nb_link_checker.py -p /directory_path -o custom_report.md # replace `/directory_path` with your custom path
-p, --project_dir
: Path to the project directory containing Jupyter notebooks (default: current directory)-o, --output_path
: Path to the output markdown file for the broken links report (default: broken_links_report.md)