- We will explore different useful extensions for the Jupyter lab.
- And different features provided by these extensions, also how to use them.
Table of content
- Universal Code Formatter
- Google Drive for JupyterLab
- JupyterLab Celltags
- JupyterLab system monitor
Jupyter notebook is open-source document formate based on JSON. It is one of the most used tools among data science enthusiasts. It helps us to run code and interact within the browser, you can visualize your code and document the process using mask-down.
Similarly, Jupiter lab is a development interface where you can manage different notebooks, codes, files, and data.
Since Jupyter notebooks and Jupyter lab have a limited set of features, we use extensions to make our code better and easier to manage. Extensions are available for both Jupyter notebook and Jupyter Lab, 5 best of them are discussed below.
Code formatting is very important to make your code look clean and readable. Code formatting is one of the problems we do not take account of when we are developing something, here this code formatted comes in hand. We can focus on our problem solving and use these code formatter to make our code looks clean and readable.
To install this package use the given commands:
# For pip environment pip install jupyterlab_code_formatter # For conda environment conda install -c conda-forge jupyterlab_code_formatter
Supported python code formatter
Supported R code formatted
More about Universal code formatter extension – Link
Debugging is an important step to remove potential bugs present in our code. Debugging in different IDE is easy, now you can also debug your code in the Jupyter notebook itself.
The debugger is officially shipped with JupyterLab 3.x, so you need not download it separately. Currently, it supported in two kernels,
- xeus-python: Jupyter kernel for the Python programming language
- xeus-robot: Jupyter kernel for Robot Framework
To install xeus-python in a new conda environment:
conda create -n jupyterlab-debugger -c conda-forge jupyterlab=3 xeus-python
conda activate jupyterlab-debugger
Features provided by Debugger
- Breaking points
We use google drive to store our data on the cloud and use it whenever needed. It is easier to add google drive to Google Colab by using a button or command. Similarly, this extension will help us to use google drive in our jupyterLab environment so that we have access to our google drive files in our notebook.
This extension adds a Google Drive file browser to the left sidebar of JupyterLab. When you are logged into your Google account, you will have the files stored in your GDrive available to JupyterLab.
To install use the given command:
jupyter labextension install @jupyterlab/google-drive
The JupyterLab cell tags extension enables users to easily add, view, and manipulate descriptive tags for notebook cells.
The extension includes the functionality to select all cells with a given tag, supporting the performance of any operation on those cells. The JupyterLab celltags extension is officially shipped with JupyterLab 3.x, so you need not download it separately.
To install it manually, use the given command:
jupyter labextension install @jupyterlab/celltags
Read more about this extension.
Most of the time we run our code on Jupyter notebook without knowing the current memory usage. Due to this many times, our notebook freezes and stops working due to memory runout. It will be beneficial if we have the statics of current memory usage and CPU usage.
JupyterLab system monitor is an extension that displays system information like CPU usage and memory usage in the Jupyter notebook.
To install use the given command:
# For pip environment pip install jupyterlab-system-monitor
You can also set a limit to your CPU usage and memory usage, see configuration here.
Extension for JupyterLab makes the code life cycle easy. The extension explained above are some of the best you can use. code formatted helps you formate your code so that you can focus on your problem-solving.
The Debugger will help you to debug your code which key part that make your code production-ready.
We use google drive in day to day life have access to Google drive make cloud file access very easy.
Similarly, Jupyter celltags is useful for documentation and lastly, the JupyterLab system monitor makes it easy for us to see the current usage of CPU and memory.
Hope you like the article and is useful to you. Do share this article with others, also check out my personal blog(https://code-ml.com/) to read more about types of widgets in Jupyter notebook and how you can create your own dashboard.
Read my latest article – Link
About the author
Mohammad Ahmad (Research engineer intern, BTech)
LinkedIn – https://www.linkedin.com/in/mohammad-ahmad-ai/
Personal Blog – https://code-ml.com/
GitHub – https://github.com/ahmadkhan242
Twitter – https://twitter.com/ahmadkhan_242
The media shown in this article are not owned by Analytics Vidhya and is used at the Author’s discretion.You can also read this article on our Mobile APP