Live Python Notebooks with any Editor
MIT License
Python notebooks without compromises.
Install:
pip install streambook
Run streambook on a Python file. For the example notebook included:
pip install matplotlib
streambook run example.py
The output should look like this streambook.
Editing your file example.py
should automatically update the viewer.
When you are done and ready to export to a notebook run:
streambook convert example.py
This produces a standard notebook.
Streambook is a simple library (< 50 lines!) that hooks together Streamlit + Jupytext + Watchdog.
A "benefit" of using notebooks is being able to keep data cached in memory, at the cost of often forgetting how it was created and in what order.
Streambook instead reruns your notebook from the top whenever the file is changed. Typically this is pretty fast for writing demos or quick notebooks.
However this can be very slow for long running ML applications, particularly for users used to standard notebooks. In order to circumvent this issue there are two tricks.
streambook run --section "Main" example.py
Streamlit's caching API to makes it pretty easy in most use case. See https://docs.streamlit.io/en/stable/caching.html for docs.
An example is given in the notebook.