Import jupyter notebooks as python modules.
- Only imports, top-level variables, and class/function definition will be imported.
- Jupyter magics can still be used in the notebook without affecting importing.
pip install jupytermodule
from jupytermodule import open
notebook_module = open("https://raw.githubusercontent.com/poga/jupytermodule/master/examples/primes.ipynb")
print(notebook_module.primes(10))
# [2,3,5,7]
# Access to top-level variables
print(notebook_module.PI)
# 3.1415$ make test
MIT