Skip to main content

A tool for diffing and merging IPython Notebook files

Project description

===============================
NBDiff
===============================

.. image:: https://badge.fury.io/py/nbdiff.png
:target: http://badge.fury.io/py/nbdiff

.. image:: https://travis-ci.org/tarmstrong/nbdiff.png?branch=master
:target: https://travis-ci.org/tarmstrong/nbdiff

.. image:: https://pypip.in/d/nbdiff/badge.png
:target: https://crate.io/packages/nbdiff?version=latest


A tool for diffing and merging IPython Notebook files.

This project was built by a team of
university students from Concordia University. See
`AUTHORS <https://github.com/tarmstrong/nbdiff/blob/master/AUTHORS.rst>`__
for more information.

* Free software: MIT license
* Website: http://nbdiff.org.

Installation
------------

Using Pip
~~~~~~~~~

If you have pip installed:

::

pipinstallnbdiffFromSource           1.Downloadthecodefromthisrepository2.Runpythonsetup.pydevelopConfigureGit/Mercurial                       Configuringnbmergetoworkwithyourversioncontrolsystemcanbehelpfulbutisnotrequired.NBMergeiscompatiblewithMercurialoutoftheboxbyrunninghgmergetool=nbmerge<branch>.Git,however,needstobeconfiguredbyaddingthefollowingtoyour.gitconfigfile:::[mergetool"nbmerge"]cmd=nbmergeLOCAL BASEREMOTE MERGEDAlternatively,youcanrunthefollowingcommandtoaddthisconfigurationautomatically::: git config --global mergetool.nbmerge.cmd = "nbmerge $LOCAL $BASE $REMOTE $MERGED"

You can then run ``nbmerge`` from git like so:

::

gitmergetooltool=nbmergeUsageNBDiff      NBDifflaunchesaserveratlocalhost:5000andallowsyoutoviewasimple2panediffoftwonotebookfiles.::usage:nbdiff[h][beforeafter]ProduceadiffedIPythonNotebookfrombeforeandafternotebooks.Ifnoargumentsaregiven,nbdifflooksformodifiednotebookfilesintheversioncontrolsystem.Theresultingdiffispresentedtotheuserinthebrowserathttp://localhost:5000.positionalarguments:beforeThenotebooktodiffagainst.afterThenotebooktocomparebeforeto.optionalarguments:h,helpshowthishelpmessageandexitNBMerge       nbmergelaunches::usage:nbmerge[h][localbaseremote[result]]nbmergeisatoolforresolvingmergeconflictsinIPythonNotebookfiles.Ifnoargumentsaregiven,nbmergeattemptstofindtheconflictingfileintheversioncontrolsystem.PositionalargumentsareavailableforintegrationwithversioncontrolsystemssuchasGitandMercurial.Oncenbmergeisrun,theUIcanbeaccessedathttp://localhost:5000positionalarguments:notebookoptionalarguments:h,helpshowthishelpmessageandexitDevelopingRunthePythontests                    Togetallofthedependenciesnecessarytotestnbdiff,run::: pip install -r requirements-dev.txt


To run the python tests, run the following command:

::

Missing open brace for subscript flake8 tests nbdiff


To check Python test coverage, install ``coverage`` and run the tests with the ``--with-coverage`` option.

::

pipinstallcoverage python setup.py nosetests --with-coverage


Run the JavaScript tests
~~~~~~~~~~~~~~~~~~~~~~~~

First, install `node <http://nodejs.org/>`__ and npm.

Second, install the JavaScript dependencies using ``npm``.

::

npminstallFinally,runthetestswithgrunt.Youshouldoutputsimilartothefollowing.Notethatgruntwillnotonlyrunthetests,butcheckforcommonstyleproblemswithjshint.:: grunt

Running "qunit:files" (qunit) task
Testing src/test/index.html ...OK
>> 14 assertions passed (21ms)

Done, without errors.





History
-------


1.0.0 (2014-03-28)
++++++++++++++++++

* End of the original capstone team project.
* First release on PyPI

1.0.3 (2014-04-15)
++++++++++++++++++

* IPython 2.0.0 support

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page