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:
enforce-notebook-run-order my_notebook.ipynb my_other_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
:
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.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f363d258ab663f9906eab2b69de88fe654004ff8f85365639a54a5b96270c07 |
|
MD5 | cd8fa6e31b25b1e445504615cb7350fb |
|
BLAKE2b-256 | 6eb13c499b6b9e097248987e87547db13752709ba8e650647130078f63210a59 |
Hashes for enforce_notebook_run_order-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a630750cf88ec580df674925fcb916a478c605be6e44164cafaecbc2158b90b |
|
MD5 | 73d451889d0287667fd6edb8c8ef227b |
|
BLAKE2b-256 | 8475e315d94da04f54a641a1567d4a3965f641008e5f76abe11887633bc1322c |