/nb_autoimports

Automatically add imports when a notebook raises a NameError.

Primary LanguagePythonMIT LicenseMIT

nb_autoimports

Install

$ pip install git+https://github.com/sshh12/nb_autoimports --upgrade

Usage

Load with %load_ext nb_autoimports and create a cell with just # autoimport:. It's best to keep this cell seperate from other code since it's contents will be overridden by this extension.

Fix basic imports

See common_index.py for built-in aliases.

basic example

Fix and rerun

rerun example

Import from custom modules

Include import names as a comma separated list. The order listed will be used as the lookup order.

custom example

More built-in imports

Fill free to PR an update common_index.py.