JupyterLab Notebook Provenance
An extension for JupyterLab (v2+) to track interaction provenance in Jupyter notebooks.
The provenance information is stored using the provenance tracking library trrack.
This extension listens to notebook change events from JupyterLab and stores these changes as a provenance graph with Trrack. The trrack-notebook-vis library takes the stored provenance information to visualize the provenacne graph in a sidepanel in JupyterLab. From the visualization, users can browse the notebook's history, filter it, and switch between states.
Install
Install JupyterLab if you haven't already.
To install the extension from the terminal, type:
jupyter labextension install @jku-icg/jupyterlab_nbprovenance
Binder
To use the extension in a JupyterLab instance from Binder, add a postBuild file with the above command to the root of the repository (see the demo branch for reference).
Development
-
Prepare Environment (optional)
conda create --name notebook_provenance python=3.8.5 conda activate notebook_provenance conda install jupyterlab
-
Clone this repo,
cd
into the folder -
Then build the extension
yarn install yarn build
-
Install the extension
jupyter labextension install --minimize=False # install the current directory as an extension
Disabling the minifier is optional, but minimizig the code is not necessary locally and it reduces the build time.
-
Start JuypterLab in watch mode
jupyter lab --watch
-
Make code changes
-
Rebuild the extension with
yarn build
or watch for file changes and built automatically withyarn watch
JupyterLab updates itself, due to the--watch
parameter -
Refresh the JupyterLab in your browser to load the updated files
Also see the JuypterLab Extension Developer Guide.
Publish
Make sure to npm login
with the user icgbot first.
npm pack --dry-run # verify files
npm publish
Attributions
This extension uses icons by fontawesome.com, available under CC BY 4.0.