Skip to content

Automatically add imports when a notebook raises a NameError.

License

Notifications You must be signed in to change notification settings

sshh12/nb_autoimports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Automatically add imports when a notebook raises a NameError.

Topics

Resources

License

Stars

Watchers

Forks

Languages