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 you want to check:
enforce-notebook-run-order my_notebook.ipynb
Or point it to a directory to check all notebooks in that directory:
enforce-notebook-run-order my_notebooks/
Pre-commit hook
To use enforce_notebook_run_order
as a pre-commit hook, add the
following to your .pre-commit-config.yaml
:
- repo: https://github.com/christopher-hacker/enforce-notebook-run-order
rev: 0.1.5
hooks:
- id: enforce-notebook-run-order
name: enforce-notebook-run-order
entry: enforce-notebook-run-order
types: [jupyter]
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-0.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | efdfada87ba0ef176dc3d4bd171573cd5eb7798e66c693a0a7b378366cbee86e |
|
MD5 | cf4a4e3aea16ed8ffe64117999fc0b45 |
|
BLAKE2b-256 | a15d7300f7d13c32f2f30bd3639483467798017bb72d3210aa18735925be7342 |
Hashes for enforce_notebook_run_order-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac1bf366a8cf10663b65801cead9cc93753b0c7c70cb6c542761262d8cc40ce9 |
|
MD5 | 65ca281d778c5750310cdd4b3b8542e9 |
|
BLAKE2b-256 | f685271588c448300c1fb61523e6aa5a0f88da7ac0e0ad9b85e06fb40f1dd5fd |