Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to generate a diff between two versions of an IPython notebook?

I have started using IPython notebook quite a bit for writing up draft sections for my dissertation. However, given two versions of a draft (i.e., notebook), I would like to be able to generate some form of diff output to show what has changed. Does anyone know if this is currently possible, either through IPython notebook itself, or through some extension?

like image 255
naitsirhc Avatar asked Aug 11 '13 12:08

naitsirhc


2 Answers

Notebook diff can be generated with nbdime. After installing nbdime you can run following to see notebook diff in browser:

> nbdiff-web notebook_1.ipynb notebook_2.ipynb

If you are using Github for version control you can use ReviewNB for Notebook diff. It lets you login via Github and browse commits/pull-request diff on your repo. You'll see visual diff like below:

enter image description here

like image 197
amirathi Avatar answered Oct 13 '22 04:10

amirathi


1- VS Code has added to its Aug 2020 version see here

2- try nbdime

like image 23
Vahab Avatar answered Oct 13 '22 02:10

Vahab