Skip to main content

Code Snippets Extension for JupyterLab

Project description

Jupyter Lab Menu Extensions


The idea of the Snippet Library is to create a tool for rapid prototyping with the aim of quickly and easily developing data analysis workflows. It adds a customizable menu to the Jupyter notebooks to insert code snippets, code examples and boilerplate code.

Snippets Showcase

This Jupyter Lab extension is based on the jupyterlab-snippets extension. How do I read a csv file? There´s a snippet for that. How do I visualize missing values in a pandas dataframe? There´s a snippet for that. How do I plot the correlation matrix of my pandas dataframe (and make it look good)?. There's a snippet for that. You get the idea.

Focus of the provided snippets is helping to get started (or to get more productive) on data science tasks. The menu provides several snippets ordered by typical task groups used for exploring and visualizing data.

The default menu provides the items:

  • Data which provides snippets to read, write and transform data.

  • Modelling which provides snippets to train ML models (mostly based on sklearn). You'll find examples for classification, regression and clustering.

  • Plotting which provides some regularly used snippets for matplotlib, bokeh and the pandas interface.

  • Utils which provides some snippets which do not fit into the former categories but are still helpful.

With the jupyter extension a set of base snippets are provided, for which we are mostly sure, that they do their job as described. Also, it's also possible to add your own snippets, either by copy-pasting them or by uploadling them from a python file.

Configuration

The follwoing Prerequisites must be installed:

Anaconda

Jupyterlab 2.X

(Python 3.X)

After installation enter the following in the three lines in the command line (Anaconda Prompt for Windows):

jupyter lab build

Install via Make (Linux)

git clone https://github.com/fraunhofer-iais/IAIS-JupyterLab-Snippets-Extension.git

cd snippetlib_jl

git checkout master

make install

Operating instructions

Start Jupyter Notebook

Windows: Open Anaconda prompt and type "jupyter notebook".

Linux: Open terminal and type "jupyter notebook“.

The Jupyter front-end should open in a browser window.

How to add your own snippets

To upload a new snippet on the jupyter notebook,paste the following in a new cell.

from snippetlib_jl import upload_snippet as us

upload_snippets = us.Upload_Snippet()

Refresh the page and on the Snippets menu you should see the newly added snippet.

To create new snippets,on the jupyter notebook,paste the following in a new cell.

from snippetlib_jl import paste_snippet as ps

paste_snippets = ps.Paste_Snippet()

Refresh the page and on the Snippets menu you should see the newly added snippet.

Add your own snippets

Credits and Acknolegements

The development of this Jupyter extension was supported by the Fraunhofer Lighhouse Project Machine Learning for Production (ML4P). The main development has been carried out by the Knowledge Discovery Department of the Fraunhofer IAIS. We would like to thank Daniel Paurat for the original idea of the project.

Contact information

If you're interested in supporting the further development of this extension or if you need support for the usage please contact snippets@iais.fraunhofer.de.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

snippetlib_jl-1.4-py3-none-any.whl (90.3 kB view details)

Uploaded Python 3

File details

Details for the file snippetlib_jl-1.4-py3-none-any.whl.

File metadata

  • Download URL: snippetlib_jl-1.4-py3-none-any.whl
  • Upload date:
  • Size: 90.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.5.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for snippetlib_jl-1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8ac44c808491218fe6cdb5ebe02cab747ecb11099909aba817c6a8381bd3639e
MD5 b519287be10fde66a110ed8d4e5a1f4d
BLAKE2b-256 444d26afb205e0984ed56256b39a024dc6b8db7484b238ff43130b85fa8e972c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page