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:
git clone https://github.com/srush/streambook
cd streambook
pip install -r requirements.txt -r requirements.example.txt; pip install .
Run streambook on example notebook:
python -m streambook 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:
jupytext --to notebook --execute example.notebook.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. This can be very slow, particularly for users used to standard notebooks.
In order to circumvent this issue, the user needs to write functions and add caching. Luckily 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.
Source Distribution
Built Distribution
Hashes for streambook-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab3851b17557cf777226ea553768f8396eabb396e61482c67fa1561a83bed73a |
|
MD5 | bfc0b47d5915231d2fb2176d96a836a1 |
|
BLAKE2b-256 | 554608a7130e5659305064c1a0d5e0651ea9ff8f1d5ce210b04139068cc42e79 |