10 Jupyter Notebook Extensions Making My Lyfe Easier

Level-up your Jupyter Notebook with these 10 Nbextensions.

Max Tingle
6 min readOct 24, 2019

Nbextensions are notebook extensions, or plug-ins, that will help you work smarter when using Jupyter Notebooks. It is best to install the extensions using Jupyter Nbextensions Configurator and Jupyter Notebook Extensions. The installation will add a tab to your Jupyter Notebook Tree where you can check and uncheck which extensions to enable.

Install Nbextensions with Anaconda from your command line:

conda install -c conda-forge jupyter_contrib_nbextensions conda install -c conda-forge jupyter_nbextensions_configuratorjupyter contrib nbextension install --user

Install Nbextensions with pip from your command line:

pip install jupyter_contrib_nbextensionspip install jupyter_nbextensions_configuratorjupyter contrib nbextension install --user jupyter nbextensions_configurator enable --user

After you have finished installing Nbextensions, there are 10 extensions that I recommend checking out that have been incredibly helpful for me (and that I wish I had discovered sooner).

Extension 1: Autopep8

Autopep8 reformats code to fix basic spacing errors that do not follow Pep8 guidelines. I recommend referencing Pep8 documentation for detailed style guidelines. However, this extension does a good job with spacing errors.

Extension 2: Spellchecker

Spellchecker highlights incorrectly spelled words in Markdown and Raw cells. It is a pretty straightforward extension that is tremendously helpful in identifying misspelled words, especially when all your text, code, and LaTeX seem to be running together.

EXTRA: LaTeX markdown editing made easier: “How to convert math equations or chemical reactions to LaTeX the easy way!”

Extension 3: Execute Time

If you are like me and work in multiple Jupyter Notebooks at a time, the Execute Time extension is a helpful reminder of what has and has not been executed as you switch between notebooks. This extension displays a line at the bottom of your code block that tells you 1) the date and time the last execution of the code cell occurred and 2) how long it took to execute.

The timing information not only allows you to quickly gage how long it will take to re-run the cell, but it also allows you to skip the step of importing Time or Timeit libraries to time the code execution.

Extension 4: Notify

This is probably my favorite extension at the moment, because I always have code running in the background and used to catch it well after the kernel was idle — but not anymore!

The Notify extension displays a web notification in the top right hand corner of your screen when the kernel becomes idle, meaning the code has finished running. The “Notify” drop-down menu in the Jupyter Notebook toolbar allows you to disable the feature or select notifications for code that takes longer than 0, 5, 10, or 30 seconds to run.

Extension 5: Skip-Traceback

Error tracebacks are just a part of life as a data scientist. However, I have found myself wasting time scrolling to the bottom of longer error tracebacks, and that’s where the Skip-Traceback extension makes life a little bit easier.

Normal traceback output:

Output with Skip-Traceback extension enabled:

The Skip-Traceback extension hides error tracebacks and instead only displays a summary that includes error name and type. If you want to view the full traceback, you can click the triangle/drop-down arrow at the end of the summary to unhide the traceback.

Extension 6: Scratchpad

Ever find yourself adding a bunch of cells in your notebook to test code as you debug? And do those cells just get in the way later?

Once enabled, Scratchpad is a cell that acts like a scratch notebook where you can execute code against the kernel without having to modify your notebook. Scratchpad cells are executed using “Shift+Enter” like a regular cell, and you can use the icon in the bottom-right of the screen or the keyboard shortcut “Ctrl+B” to toggle Scratchpad.

Extension 7: Snippets Menu

And this is where extensions really start doing the work for you. The Snippets Menu extension adds a menu item to your Jupyter Notebook where you can search for snippets, boilerplate, and examples of code to insert into your notebook.

Extension 8: Initialization Cells

The Initialization Cells extension allows you to mark cells as ‘initialization cells’ that will run automatically when the notebook is opened or when clicking the initialization button in the main toolbar.

The first time you open a notebook with initialization cells enabled, a warning will display saying the notebook is untrusted. You can choose to trust the notebook, after which the notebook will re-open in trusted mode and run your initialization cells.

Turn on the cell toolbar within your notebook menu using “View > Cell Toolbar > Initialization Cell.”

Extension 9: Collapsible Headings

Collapsible Headings, another one of my favorites, allows you to organize your notebook into sections indicated by markdown heading sections that collapse. You can indicate up to 6 heading levels in your markdown by using hashtags (#). For your first level heading, you use one hashtag and a space before the heading title, and you increase the number of hashtags before the heading title per heading level.

Extension 10: Table of Contents (2)

Last, but certainly not least, Table of Contents (2) displays the index of collapsable headings in a floating window or as a docked sidebar. The extension includes the option to add a ToC cell to the top of your notebook.

You can use the Table of Contents (2) to scroll through your notebook, jump to specific sections, and collapse sections.

And there you have it — 10 time-saving Jupyter Notebook Extensions that are making my life easier. I hope they do the same for you!

If you are just getting started with Jupyter Notebooks, I recommend reading: “Jupyter Notebook for Beginners: A Tutorial.”

If you are interested in Jupyter Magic, I recommend: “Tips, Tricks, Hacks, and Magic: How to Effortlessly Optimize Your Jupyter Notebook.”

And for more Jupyter Notebook hacks, I recommend: “10 Simple Hacks to Speed Up Your Data Analysis in Python” and “Bringing the Best Out of Jupyter Notebooks for Data Science.”

--

--

Max Tingle

Data Engineering Specialist at DC Public Charter School Board in Washington, DC.