H2O Wave Documentation

website·Indexed 41 days ago

https://wave.h2o.ai/

A software stack for building low-latency, realtime, browser-based applications and dashboards using Python. The documentation covers server configuration, ASGI program development, UI widgets (forms, stats, tabs), custom CSS and theming, file uploads, and WaveDB, a SQLite-based HTTP interface.

Tokens
210.7K
Snippets
1K
Records
1.2K
Agent score
62%

What's inside H2O Wave

  1. Overview of Wave data buffers

    Data buffers are in-memory tabular data structures (containing columns and rows) designed to hold a card's data. They allow developers to separate data from presentation, meaning a card can be declared once and its underlying data buffer updated multiple times. A single card can hold zero or more data buffers.
  2. Overview of H2O Wave

    H2O Wave is a software stack used to build low-latency, real-time, browser-based applications and dashboards entirely in Python. It eliminates the need for HTML, JavaScript, or CSS by allowing developers to push content to connected clients in real-time. It is particularly suited for live monitoring dashboards, news tickers, instant notification apps, chat bots, and collaborative tools.
  3. Overview of the h2o_wave Python driver

    The h2o_wave Python package is a driver for H2O Wave, a lightweight software stack used to program interactive, low-latency, real-time, and collaborative web applications entirely in Python. It eliminates the need for HTML, JavaScript, or CSS by providing a suite of built-in form and data visualization components. The system relies on a Wave relay server to synchronize state between the Python backend and web browsers.
  4. Understand the H2O Wave programming model

    H2O Wave follows a stateful server model where the Wave server retains content independently of the script that created it.

    1. Site: A collection of pages accessible by route keys.
    2. Page: A collection of cards. To change a page, you modify its cards and call save().
    3. Card: A block of content (text, graphics, widgets). The box attribute defines its position and size on the grid.
    4. Persistence: Because the server retains content, a script can exit, but the page remains visible to users until changed by another script or process.
  5. H2O Wave Architecture Overview

    H2O Wave is a software stack for building low-latency, real-time, browser-based applications and dashboards using only Python. It eliminates the need for HTML, JavaScript, or CSS by using a three-tier architecture:

    1. Wave Server: A static binary executable (~10MB) that acts as a content server, HTTP web server, and proxy. It stores site content, transmits changes to browsers, and relays browser events to apps.
    2. Language Driver: The h2o-wave PyPI package used by Python scripts and apps to manage content on the server via an idiomatic Python API.
    3. Browser-based Client: The user interface that renders content and transmits user actions (events) back to the server.
  6. Start and configure the H2O Wave server

    The H2O Wave server can be started in two ways: using the wave run command (which automatically starts the waved server and is ideal for development) or by running the waved server binary directly (ideal for deployment or remote server hosting).

    Configuration settings are applied based on the following priority (highest to lowest):

    1. Command line arguments
    2. Environment variables
    3. Configuration files (e.g., .env)
    4. Default settings
  7. Render vector graphics using ui.graphics_card

    Wave provides a graphics card component, ui.graphics_card(), to render SVG vector graphics backed by data buffers. The card uses two primary attributes to manage rendering performance: stage for static background elements and scene for elements that require animation or frequent updates.
  8. Start and configure the H2O Wave server

    The H2O Wave server can be started in two ways depending on the environment: use the wave run command for development (which starts the waved server automatically) or use the waved server binary directly for deployment or remote server setups.

    Configuration settings can be applied via command line arguments, environment variables, or a configuration file (e.g., .env). The priority order for these settings is: Command line arguments > Environment variables > Configuration file > Default values.

  9. Access H2O Wave technical documentation and API

    For deep dives into the framework, use the following resources:

    • Detailed Guides: Covers core concepts including Architecture, Wave Scripts, Apps, Pages, Layouts, Cards, Data Buffers, Components, Query Arguments, App State, Routing, Realtime Sync, Background Tasks, Data-binding, Files, Plots, Javascript, Graphics, Security, Logging, CLI, Development, Browser Testing, Configuration, Deployment, and Backup/Recovery.
    • API Reference: Detailed documentation on all available functions, their parameters, and outputs.
    • Change Log: An ordered list of new features and updates.
  10. Download Wave examples and binaries using wave fetch

    Use wave fetch to download example applications and the waved server binary into a local ./wave folder. You can optionally specify the target platform and architecture.
    # Download examples and waved
    wave fetch
    
    # Download for a specific platform and architecture
    wave fetch --platform linux --arch amd64
  11. Display status and informational messages using ui.message_bar

    The ui.message_bar component is used to notify users about application states, such as success, failure, warnings, or general information. The component supports plaintext, markdown, and HTML for the message text.

    Available type options include:

    • blocked: Indicates an action is blocked.
    • error: Indicates an error occurred.
    • warning: Indicates a warning.
    • info: Provides general information.
    • success: Indicates a successful operation.
    • danger: Indicates a critical danger state.
    q.page['form'] = ui.form_card(
        box='1 1 4 7',
        items=[
            ui.message_bar(type='blocked', text='This action is blocked.'),
            ui.message_bar(type='error', text='This is an error message'),
            ui.message_bar(type='warning', text='This is a warning message.'),
            ui.message_bar(type='info', text='This is an information message.'),
            ui.message_bar(type='success', text='This is an success message.'),
            ui.message_bar(type='danger', text='This is a danger message.'),
            ui.message_bar(type='success', text='This is a **MARKDOWN** _message_.'),
            ui.message_bar(type='success', text='This is an <b>HTML</b> <i>message</i>.'),
        ]
    )
    
  12. WaveDB architecture and client compatibility

    WaveDB is built with Go and based on SQLite. Because it provides an HTTP and JSON interface, it can be used from any language or platform with HTTP/JSON libraries. The official Python client is implemented using HTTPX.