Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davidbrochart/subnotebook
Call Jupyter notebooks as Python functions
https://github.com/davidbrochart/subnotebook
jupyter-notebook python
Last synced: about 2 months ago
JSON representation
Call Jupyter notebooks as Python functions
- Host: GitHub
- URL: https://github.com/davidbrochart/subnotebook
- Owner: davidbrochart
- Created: 2020-03-31T21:40:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-13T10:08:14.000Z (over 4 years ago)
- Last Synced: 2024-10-12T15:12:01.250Z (2 months ago)
- Topics: jupyter-notebook, python
- Language: Python
- Size: 79.1 KB
- Stars: 54
- Watchers: 5
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Subnotebook
Run a notebook as you would call a Python function.
Two modes are currently supported:
- An in-process mode, where the subnotebook is executed in the same kernel your
interpreter is running in (but in a different name space). This allows to pass
parameters and get results back, including widgets.
```python
from subnotebook import run_nbab, ba, slider, output = run_nb('sub_notebook.ipynb', a='c', b='d')
```- An out-of-process mode, where the subnotebook is executed and served using
[Voila](https://voila.readthedocs.io), and included in the main notebook as an
IFrame. This mode only allows to display the outputs of the subnotebook, which
is useful for offloading the main notebook but also to offer a UI to resources
you would not have access to, such as big data or protected data.
```python
from subnotebook import display_nbdisplay_nb('widget_notebook.ipynb')
```