nbview

Compare two Jupyter notebooks

nbview shows what changed between two .ipynb files, cell by cell, in the browser. Neither notebook is uploaded: each one is read from GitHub, a gist or a link by the browser that is showing it.

How to compare

  1. Open nbview’s compare page, or choose Compare in the toolbar of any notebook you already have open.
  2. Paste a link to each notebook, or pick two .ipynb files from your disk. The two can sit in different repositories, branches or folders.
  3. Read the diff. Each changed cell is shown with the version it came from, and a swap button above it flips the two sides.

A link can carry the comparison itself, so a review comment or a class note can point at it. The # is part of the address: the viewer routes on it, so a link without one lands on the home page.

/#/compare/github/{owner}/{repo}/{older}...{newer}/{path}.ipynb
/#/compare/links/{first-notebook-link}/{second-notebook-link}

What the diff shows

Private repos, and notebooks on your disk

Files you choose from your disk are read in the page and never leave the browser. Private repositories work once a fine-grained GitHub token with Contents: Read-only is saved: the token stays in this browser and is sent only to api.github.com.

How this compares with other notebook diffs

ToolWhere it runsWhat it needs
nbdimeOn your machine, as a Python package, CLI or JupyterLab extensionThe notebooks already downloaded, plus a Python install
ReviewNBAs a GitHub App, on pull requestsInstall access to the repositories you want to review
nbviewIn the browser, given two links or two filesNo install or app; public notebooks need nothing, private ones a read-only token
Compare two notebooks View .ipynb files from GitHub

nbview is a free, open-source notebook viewer. It is an independent project and is not affiliated with Project Jupyter or nbviewer. Open the viewer, read the README, or see what changed, or read the privacy note.

Private repos

To open notebooks from private repos, use a fine-grained token with Contents: Read-only access to those repos. A classic token with no scopes works for public repos and raises the folder-browsing limit.

Folder browsing allows 60 requests an hour without a token and 5,000 with one; opening public notebooks does not use that limit. The token is stored in this browser only and sent only to api.github.com. The privacy page lists everything nbview keeps.

Create a fine-grained token

Compare

Compare at with another version of it, or with a different notebook.

Embed this notebook

Paste this into any page that allows iframes. The notebook is fetched and drawn by the reader’s browser, so nothing is uploaded, and the frame always shows the latest version of the file.