AuthorsV. T. Fauske, M. S. Alnæs and B. Ragan-Kelley
Titlenbdime: Notebook Diffing and Merging
AfilliationSoftware Engineering
Project(s)OpenDreamKit: Open Digital Research Environment Toolkit for the Advancement of Mathematics, Center for Biomedical Computing (SFF)
Publication TypeTalks, contributed
Year of Publication2016
Location of TalkEuroSciPy 2016, Erlangen, Germany

Jupyter Notebooks have become an integral part of many scientific data projects, as it allows for intuitive combination of explanatory text, computation and (interactive) outputs. While most tools for working with Jupyter Notebooks present a neat and ordered interface, version control of Notebooks based on simple text-based diffs and merges of the JSON format can quickly become unwieldy. A prominent example is when an image in a cell’s output has changed, in which case the diff will be dominated by the embedded, base64-encoded image data. Other issues involve a lack of source syntax highlighting, as well as a lack of filtering away inconsequential changes to volatile outputs and metadata.


To solve these issues, Nbdime implements Notebook-specific diff, patch and merge routines, as well as both command-line and browser based diff and merge tools. In this way, cell sources can be compared intuitively with syntax highlighting, volatile metadata can optionally be ignored, and output comparison can be informed by its MIME types, for example by showing side-by-side comparisons of images in the browser.

Citation Key25480