A simple template for jupyter notebooks.
The extension sets up any new Jupyter Notebook with a conventional and general-purpose template to shape Data Science analysis.
The template includes conventional sections, like Data Import, Processing and References, as well as code to perform common operations, like importing and configuring charting libraries.
Moreover, it prompts for a meaningful name whenever you try and save a notebook called 'Untitled'.
Find this annoying? Don't worry, you can disable this one.
Jupyter notebooks are awesome tools: they enable fast prototyping and ease result sharing. However, due to their flexibility, they are prone to be abused.
In order to help Data Scientists keep their notebooks clean, a reasonably flexible yet conventional template may help. Moreover, the template is also a productivity tool, speeding up common setup, such as library import and configuration.
We assume Jupyter notebook is already installed in your environment. However, even if this is not the case, don't worry: jupytemplate declares Jupyter notebook as a dependency, thus any package manager, like pip, will install it for you.
It is not mandatory, but you can install the full set of Jupyter extensions.
pip install jupyter_contrib_nbextensions jupyter contrib nbextension install --user
Feel free to visit their repository for more information.
Now you can install the package:
pip install jupytemplate
jupyter nbextension install --py jupytemplate --sys-prefix
Finally, you may want to enable the extension:
jupyter nbextension enable jupytemplate/main --sys-prefix
You can easily enable, disable or configure the extension by using the nbextension_configurator server extension, as shown below.
Template location can be found by running:
import jupytemplate print(jupytemplate.get_template_path())
Of course, you can edit the template as you like, in order
to adapt it to your own needs, but keep the file name
After editing the template, run:
jupyter nbextension install --py jupytemplate --sys-prefix jupyter nbextension enable jupytemplate/main --sys-prefix
to make changes effective.
Please consider reading the following resources for a more comprehensive understanding:
A similar extension for Jupyter Lab has been developed by the Data Science group in JP Morgan Chase! Feel free to check out their repository at https://github.com/jpmorganchase/jupyterlab_templates.