Skip to content

JuypterLab extension for provenance tracking in notebooks.

License

Notifications You must be signed in to change notification settings

jku-vds-lab/jupyterlab_nbprovenance

 
 

Repository files navigation

JupyterLab Notebook Provenance

npm (scoped)

An extension for JupyterLab 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.

🚀 Try it out on Binder: Binder

Extension Demonstration

Install

Install JupyterLab if you haven't already.

To install the extension from the terminal, type:

jupyter labextension install @jku-icg/jupyterlab_nbprovenance

Docker

Alternatively, this repository also contains a Docker configuration to create a container with Juypter Lab and install the extension.

Simply run:

docker-compose up lab

The environment is based on jupyter/scipy-notebook and should comes with the most popular Python packges, including altair, pandas, scikit-learn, seaborn, and matplotlib.

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

  1. Prepare Environment (optional)

    conda create --name notebook_provenance python=3.8.5
    conda activate notebook_provenance
    conda install jupyterlab
  2. Clone this repo, cd into the folder

  3. Then build the extension

    npm install
    npm run build
  4. 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.

  5. Start JuypterLab in watch mode

    jupyter lab --watch
  6. Make code changes

  7. Rebuild the extension with npm run build or watch for file changes and built automatically with npm run watch
    JupyterLab updates itself, due to the --watch parameter

  8. 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.

About

JuypterLab extension for provenance tracking in notebooks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 87.0%
  • JavaScript 8.9%
  • CSS 3.5%
  • Dockerfile 0.6%