https://github.com/sshh12/nb_autoimports
Automatically add imports when a notebook raises a NameError.
https://github.com/sshh12/nb_autoimports
auto-import data-science-tools jupyter-notebook
Last synced: about 2 months ago
JSON representation
Automatically add imports when a notebook raises a NameError.
- Host: GitHub
- URL: https://github.com/sshh12/nb_autoimports
- Owner: sshh12
- License: mit
- Created: 2021-06-05T14:42:02.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-08T23:18:17.000Z (about 5 years ago)
- Last Synced: 2025-04-08T15:50:14.807Z (about 1 year ago)
- Topics: auto-import, data-science-tools, jupyter-notebook
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/sshh12/nb_autoimports/blob/main/nb_autoimports/common_index.py) for built-in aliases._

### Fix and rerun

### Import from custom modules
_Include import names as a comma separated list. The order listed will be used as the lookup order._

## More built-in imports
Fill free to PR an update [common_index.py](https://github.com/sshh12/nb_autoimports/blob/main/nb_autoimports/common_index.py).