An open API service indexing awesome lists of open source software.

https://github.com/iamarunbrahma/nb-link-checker

Scan and validate links in notebooks
https://github.com/iamarunbrahma/nb-link-checker

broken-link-checker broken-link-finder

Last synced: 3 months ago
JSON representation

Scan and validate links in notebooks

Awesome Lists containing this project

README

        

# Notebook Link Checker

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.

## Features

- 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.

## Installation

1. Install uv (if not already installed):
```bash
pip install uv
```

2. Clone the repository and set up the environment:
```bash
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
```

3. Install dependencies:
```bash
uv pip install -r requirements.txt
uv pip install -r requirements-dev.txt # For development
```

## Usage

Basic usage with default settings:
```bash
python nb_link_checker.py
```

Specify a custom project directory and output file:
```bash
python nb_link_checker.py -p /directory_path -o custom_report.md # replace `/directory_path` with your custom path
```

### Command Line Arguments

- `-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)