5 Must Have JupyterLab extension for data science!

Mohammad Last Updated : 27 May, 2021
5 min read

This article was published as a part of the Data Science Blogathon

Overview

  • 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

  • Introduction
  • Universal Code Formatter
  • Debugger
  • Google Drive for JupyterLab
  • JupyterLab Celltags
  • JupyterLab system monitor
  • Conclusion

Introduction

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.

Jupyter notebook Extensions are simple add-ons that can increase the number of features to extend Jupiter notebook’s usability. These extensions are written in Javascript and can add features like code formatting, adding more visualization, code debugging, etc.

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.

Universal Code Formatter

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

code formatter

                                                                                             (Source)

More about Universal code formatter extension – Link

Debugger

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

  • Variables
  • Callstack
  • Breaking points
  • Source
Jupyterlab extension | debugger

                                                                                             (Source)

Tutorial notebook to try the debugger – Link. More about debugger – Link.

Google drive for JupyterLab

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
Google drive

                                                                                             (Source)

Setup Google drive for your JupyterLab – Link. Read more about this extension.

JupyterLab Celltags

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
Jupyterlab extension | celltags

                                                                                             (Source)

Read more about this extension.

JupyterLab system monitor

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
Jupyterlab extension | system monitor

                                                                                             (Source)

You can also set a limit to your CPU usage and memory usage, see configuration here.

Conclusion

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.

There are a lot of extensions available for JupyterLab, In this article, I introduced the 5 best you can use. Explore more here – Link 1 Link 2

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

References

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. 

Responses From Readers

Clear

Congratulations, You Did It!
Well Done on Completing Your Learning Journey. Stay curious and keep exploring!

We use cookies essential for this site to function well. Please click to help us improve its usefulness with additional cookies. Learn about our use of cookies in our Privacy Policy & Cookies Policy.

Show details