Skip to content

Instantly share code, notes, and snippets.

View matthewwardrop's full-sized avatar

Matthew Wardrop matthewwardrop

View GitHub Profile
@matthewwardrop
matthewwardrop / notebook_runner.py
Last active April 3, 2024 21:55
In-Process Jupyter Notebook Runner
# (c) Matthew Wardrop 2019; Licensed under the MIT license
#
# This script provides the ability to run a notebook in the same Python
# process as this script, allowing it to access to variables created
# by the notebook for other purposes. In most cases, this is of limited
# utility and not a best-practice, but there are some limited cases in
# which this capability is valuable, and this script was created for
# such cases. For all other cases, you are better off using the
# `nbconvert` execution API found @:
# https://nbconvert.readthedocs.io/en/latest/execute_api.html