No project description provided
Project description
Streambook
Python notebooks without compromises.
- Write your code in any editor (emacs, vi, vscode)
- Use standard tools (git, black, lint, pytest)
- Export to standard Jupyter format for collaboration
Quick start
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.
How does this work?
Streambook is a simple library (< 50 lines!) that hooks together Streamlit + Jupytext + Watchdog.
- Streamlit - Live updating webview with an advanced caching system
- Jupytext - Bidirectional bridge between plaintext and jupyter format
- Watchdog - File watching in python
Is this fast enough?
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.
- You can divide your notebook us into sections. This allows you to edit individual parts of the notebook.
streambook run --section "Main" example.py
- You can write functions and add caching.
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.
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.