Import IPython Notebooks as modules (with Jupyter v4).
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.
pip install nbimporter
def a(): print("Hello World"!)
import nbimporter from foo import a #import from notebook a()