Move import statements in jupyter notebook to the first cell
Project description
nb_move_imports
Move import statements in jupyter notebook to the first cell
Use nb_move_imports
To run the script on a specific jupyter notebook run:
nb_move_imports path/to/notebook.ipynb
Skip processing of cells
In order to skip a cell you have to tag it with the IGNORE_MV_IMPORTS
tag.
Precommit Hook
Add this section to your pre-commit-config.yaml
so that the nb_move_imports script is executed before each commit with pre-commit.
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 0.2.0
hooks:
- id: nb_move_imports
name: nb_move_imports
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nb_move_imports-0.3.0.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for nb_move_imports-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c1b898f47dcc410c4d7fe09dcd58c8820fd9be3355d6968433ff4761fa2c78b |
|
MD5 | e4b65e4042f64267eb97b28b8e022d40 |
|
BLAKE2b-256 | fb8163d1a1659bf7bc3eb44a6222b1b1bb3d3c460792c3a1e597d71c9c272b69 |