Overview
Exercises: 25 min
- How can we use JupyterLab for Open Science by default?
- What are JupyterLab extensions?
- How can we extend JupyterLab?
- Learn to use JupyterLab for Open Science
- Learn where to find JupyterLab extension
- Learn how to create new JupyterLab extension
1 - Introduction to JupyterLab
What is Jupyterlab?
JupyterLab is the next-generation web-based user interface for Project Jupyter. It is made of modular building blocks:
- File explorer
- Text editor
- Diagram generator
- jupyter notebooks supporting more than 50 different Jupyter kernels
- Terminals
- Outputs
with an easy integration with Jupyterlab extension such as jupyterlab-latex for live-editing of LaTeX documents, jupyterlab-git and jupyterlab-nbdime for git integration, jupyterlab-drawio for creating diagrams and jupyterlab-zenodo to easily publish research work and get proper DOI.
See JupyterLab slides from JupyterLab Github demo repository for more information about JupyterLab.
Create a new isolated environment
Whenever you start with a new research project, it is good practice to create a new isolated environment, for instance:
- conda to record all the dependencies, with well defined versions
- docker or Singularity containers to bundle all the necessary ingredients (data, code, environment).
For this short workshop, we have prepared a github repository to be run with mybinder:
- Click here or on the Interact button at the top of this page to start the workshop.
Get familiar with Jupyterlab
Start JupyterLab:
You can also run the JupyterLab demo with Binder.
JupyterLab extensions
The JupyterLab Graphical User Interface varies depending on the available kernels (python
, R
, julia
, etc.) but also on the JupyterLab extensions you have installed.
And this is where JupyterLab differs from the “classical” Jupyter Notebooks.
Warning
JupyterLab extensions make JupyterLab highly flexible and can really offer a fully customized user environment but the following recommendations are important:
- only install extensions you can trust (as it allows to execute arbitrary code on the server, kernel, and in the client’s browser)
- some extensions may not be compatible with some versions of JupyterLab and may break it (as extensions are developed independently of JupyterLab).
Several extensions have been installed for you to try:
- jupyterlab-latex for live-editing of LaTeX documents,
- jupyterlab-git and jupyterlab-nbdime for git integration.
In new version of JupyterLab, an extension Manager has been included to facilitate the management of extensions in JupyterLab.
Remark
When using JupyterLab through binder
- installation of additional extensions is usually not possible.
- configuration of git (and github for accessing remote repositories) needs to be done.
Finally, as you probably already guessed, JupyterLab extensions can be developed independently of JupyterLab itself and anyone can create and distribute new extensions. You can find a step by step tutorial on how to create a new extension. However, before starting any new development, make sure you find out whether this extension already exist or not.
Key points
JupyterLab as a tool for all phases of research process.