No project description provided
Project description
enforce-notebook-run-order
Enforce the run order of Jupyter notebooks.
Jupyter notebooks are great for interactive data analysis. However, when they can encourage a bad habit: running cells out of order. This can lead to notebooks being committed to the repository in a state where they don't run from top to bottom, and other collaborators may receive different results when running the notebook from top to bottom.
enforce-notebook-run-order
enforces the run order of a notebook by
raising an exception if any cells are run out of order.
Installation
enforce-notebook-run-order
can be installed via pip:
pip install enforce-notebook-run-order
It can also be set up as a pre-commit hook. See the pre-commit hook section for more details.
Usage
enforce-notebook-run-order
can be used as a standalone script, or as a
pre-commit hook.
Standalone
To use enforce-notebook-run-order
as a standalone script, simply run
it with the path to the notebook(s) you want to check:
nbcheck my_notebook.ipynb my_other_notebook.ipynb
Or point it to a directory to check all notebooks in that directory:
nbcheck my_notebooks/
You can also use the full enforce-notebook-run-order
command, but the
nbcheck
command is provided as a convenience.
For information on the command line interface, please refer to the CLI documentation.
pre-commit hook
To use enforce_notebook_run_order
as a pre-commit hook, add the
following to your .pre-commit-config.yaml
:
repos:
- repo: https://github.com/christopher-hacker/enforce_notebook_run_order
rev: 1.0.0
hooks:
- id: enforce-notebook-run-order
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for enforce_notebook_run_order-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 504ec7edfbe6fc7544808e05af57a5786e1a938275b9e282acb3d2a34809b1bb |
|
MD5 | ab9f66a785edc88f86719cd3e951a7f4 |
|
BLAKE2b-256 | 09709291a8b20d88331834285415e58e1623fd7d86a3053fa7bc8042a320df6e |
Hashes for enforce_notebook_run_order-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35c5b25e5204effef539b5e34267ad013668889aa4fea64b45b24fc8de07a843 |
|
MD5 | 185354da80f8b04199042a42c6ddb11c |
|
BLAKE2b-256 | 0897414dcc9a66cab6c7d03d280f917e1b9a7a388006b17c8da4100cf735a515 |