Import IPython notebooks as modules in Jupyter.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 1 commit ahead, 13 commits behind grst:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
display_nb.py
nbimporter.py
setup.py

README.md

nbimporter

Import IPython Notebooks as modules (with Jupyter v4).

Origin

This is a modified version of code originally collated from https://github.com/adrn/ipython/blob/master/examples/Notebook/Importing%20Notebooks.ipynb Check out that notebook for full documentation and to understand the backgrounds.

Installation

pip install nbimporter

Usage

Notebook foo.ipynb:

In[1]:

def a(): 
    print("Hello World"!)

Notebook bar.ipynb:

In[1]:

import nbimporter
from foo import a #import from notebook

a()

Out[1]:

Hello World!