GithubHelp home page GithubHelp logo

leiloong / jupytemplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xtreamsrl/jupytemplate

1.0 1.0 0.0 6.33 MB

Templates for jupyter notebooks

Home Page: https://towardsdatascience.com/stop-copy-pasting-notebooks-embrace-jupyter-templates-6bd7b6c00b94

License: MIT License

Python 22.88% JavaScript 30.32% Jupyter Notebook 46.80%

jupytemplate's Introduction

Jupyter template

Lifecycle: experimental GitHub PyPI - Python Version PyPI Build Status GitHub issues Downloads Downloads Say Thanks!

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'.

You find this annoying? Don't worry, you can disable this one.

Usage example_gif - see github repo

Motivation

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.

Quick start

We assume Jupyter notebook is already installed in your environment. However, even if this is not tha 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

Then, you have to install the javascript files from the Python package in a conventional jupyter directory:

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.

Configuration screenshot 1 - see github repo

Configuration screenshot 2- see github repo

Editing the template

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 template.ipynb.
After editing the template, run:

jupyter nbextension install --py jupytemplate --sys-prefix
jupyter nbextension enable jupytemplate/main --sys-prefix

to make changes effective.

References

Please consider reading the following resources for a more comprehensive understanding:

jupytemplate's People

Contributors

donlelef avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.