Skip to main content

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?

image

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streambook-0.1.2.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

streambook-0.1.2-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page