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
- Host: GitHub
- URL: https://github.com/iamarunbrahma/nb-link-checker
- Owner: iamarunbrahma
- License: mit
- Created: 2025-01-22T04:56:07.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-01-22T07:41:22.000Z (3 months ago)
- Last Synced: 2025-02-08T03:32:22.517Z (3 months ago)
- Topics: broken-link-checker, broken-link-finder
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)