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:

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?

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. 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.

  1. You can divide your notebook us into sections. This allows you to edit individual parts of the notebook.
streambook run --section "Main" example.py
  1. 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


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.3.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streambook-0.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file streambook-0.3.tar.gz.

File metadata

  • Download URL: streambook-0.3.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.3 tqdm/4.60.0 importlib-metadata/4.0.1 keyring/23.0.1 rfc3986/1.4.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for streambook-0.3.tar.gz
Algorithm Hash digest
SHA256 e8d4cc4d183f97878198f9fce840052e14fad601c350ffb4a49848ddd5b751dc
MD5 76e8b74501662acd7ee5d44b6df52221
BLAKE2b-256 b823614ad69c5e4602e6d8a2df6110da65cc378a93d795f7cf979b4f59b40b37

See more details on using hashes here.

File details

Details for the file streambook-0.3-py3-none-any.whl.

File metadata

  • Download URL: streambook-0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.3 tqdm/4.60.0 importlib-metadata/4.0.1 keyring/23.0.1 rfc3986/1.4.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for streambook-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2b3fdf09b4be5e097ee03e575c56d88573375db029812e67b4e289cc35f8e20d
MD5 3117add60f621c61c1f3631d64a8edda
BLAKE2b-256 380599b9e21b0de5837c945a3e29a5e5de00dfce8d95d2d3a4acba2f80829ba3

See more details on using hashes here.

Supported by

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