2025-11-02

Alternative Workflows for Jupyter

In this blog post we present alternative ways to use Jupyter notebooks beyond the traditional server-backed workflow. The standard Jupyter setup, Jupyter Notebook or JupyterLab, typically runs a Python kernel on a local or remote server and serves an interactive web UI for editing, executing, and visualizing code. While this model is powerful for development and data exploration, it can be heavyweight to deploy and share, and depends on a running kernel and server environment.

First, as demonstrated in the video below, we show how to create a simple presentation using JupyterLite, the WebAssembly-based, browser-native version of JupyterLab, together with the jupyterlab-desk extension.

JupyterLite runs entirely in the browser, requires no server, and makes sharing interactive slides or notebooks trivial, an instance with the JupyterLab-deck extension already installed can be accessed here:

   https://tessarinseve.pythonanywhere.com/jupyterlite

The design tool in JupyterLab‑Deck is a visual Slide Layout editor: an overlay canvas that lets you arrange notebook cells as slide elements by dragging, resizing, and positioning them; adjust layout properties (z‑index, zoom, opacity); and assign slide roles via a Property Inspector. It turns cells into configurable building blocks (full slides, sub‑slides, fragments, or skipped items) so you can design the presentation’s layout and flow without editing Markdown or CSS.

The table below provides a quick reference.

Slide Roles (Cell Types)

Slide

Starts a new slide

Subslide

Nested slide under the current slide

Fragment

Reveals content incrementally

Skip

Hidden from the slideshow

Notes

Speaker notes (not shown to audience)

Euporie

Euporie is a Python-based tool for working with Jupyter notebooks directly in the terminal. Euporie provides a terminal-based interactive computing environment, allowing you to interact with Jupyter kernels without needing a graphical interface.

The second part of the video above shows two euporie's subcommmands. euporie-notebook.exe launches Euporie's terminal-based notebook editor. It lets you open and interact with Jupyter notebooks entirely from the command line, using keyboard shortcuts and text-based navigation—ideal for environments without a graphical interface.

Then euporie-console.exe starts an interactive console session connected to a Jupyter kernel. As shown in the video, it also works smoothly with tools like VHS, which let you record short terminal videos.

VHS Cli

VHS it’s a lightweight way to create scripted demos or tutorials without needing a graphical interface. To get started, you’ll need to install VHS, which is available as a downloadable binary for Windows from its GitHub releases page. Once installed, you can write a simple .tape scripts that simulate typing commands, running them, and capturing the output. These scripts are then rendered into animated MP4 that showcase your terminal workflow.

Below, you can find the script used to generate the last segment of the video.


    # VHS documentation
    # Documentation can be generated via cli with 'vhs new finame.demo'
    Output ipynbconsole.mp4

    Require echo

    Set Shell "powershell"
    Set FontSize 24
    Set Width 1200
    Set Height 800
    Type @120ms "euporie-console.exe --lsp" Sleep 500ms  Enter
    Sleep 1s
    Type @120ms "from indexcard import show_index_card" Sleep 200ms Enter
    Type @150ms "show_index_card('Python Tip', 'Use list comprehensions for cleaner loops.\nExample: [x*x for x in range(10)]')"
    Sleep 200ms Shift+Enter
    Sleep 4s
    Type @150ms "[x*x for x in range(10)]" Sleep 100ms Shift+Enter
    Sleep 8s
    Ctrl+Q
    Sleep 5s

VHS requires ttyd available in the PATH. Like VHS, ttyd also offers downloadable binaries for Windows on its GitHub releases page. Download the binary and rename it ttyd.exe inside a directory within the PATH environmental variable.

Together, VHS and ttyd make it easy to record, share, and present terminal-based workflows in a streamlined and reproducible way—all from the command line.

Finally, below you can find the python module that displays a styled index card in the terminal.


    # indexcard.py

    from rich.console import Console
    from rich.panel import Panel
    from rich.text import Text

    console = Console()

    def show_index_card(title: str, content: str, style: str = "cyan", padding=(1, 2), expand=False):
        """
        Display a styled index card in the terminal.

        Parameters:
        - title (str): Title of the card (can include emojis)
        - content (str): Body text of the card
        - style (str): Border color/style (default: "cyan")
        - padding (tuple): (top_bottom, left_right) padding
        - expand (bool): Whether to expand to full width
        """
        card = Panel(
            Text(content, justify="left"),
            title=title,
            border_style=style,
            padding=padding,
            expand=expand
        )
        console.print(card)

YearFolio Diary