Standalone HTML viewer generation for OpenAdapt ML dashboards and benchmarks
Project description
openadapt-viewer
Reusable component library for OpenAdapt visualization. Build standalone HTML viewers for training dashboards, benchmark results, capture playback, and demo retrieval.
Features
- Component-based: Reusable building blocks (screenshot, playback, metrics, filters)
- Composable: Combine components to build custom viewers
- Standalone HTML: Generated files work offline, no server required
- Consistent styling: Shared CSS variables and dark mode support
- Alpine.js integration: Lightweight interactivity out of the box
Installation
pip install openadapt-viewer
Or with uv:
uv add openadapt-viewer
Quick Start
Using Components
from openadapt_viewer.components import (
screenshot_display,
playback_controls,
metrics_grid,
filter_bar,
badge,
)
# Screenshot with click overlays
html = screenshot_display(
image_path="screenshot.png",
overlays=[
{"type": "click", "x": 0.5, "y": 0.3, "label": "H", "variant": "human"},
{"type": "click", "x": 0.6, "y": 0.4, "label": "AI", "variant": "predicted"},
],
)
# Metrics cards
html = metrics_grid([
{"label": "Total Tasks", "value": 100},
{"label": "Passed", "value": 75, "color": "success"},
{"label": "Failed", "value": 25, "color": "error"},
{"label": "Success Rate", "value": "75%", "color": "accent"},
])
Using PageBuilder
Build complete pages from components:
from openadapt_viewer.builders import PageBuilder
from openadapt_viewer.components import metrics_grid, screenshot_display
builder = PageBuilder(title="My Viewer", include_alpine=True)
builder.add_header(
title="Benchmark Results",
subtitle="Model: gpt-5.1",
nav_tabs=[
{"href": "dashboard.html", "label": "Training"},
{"href": "viewer.html", "label": "Viewer", "active": True},
],
)
builder.add_section(
metrics_grid([
{"label": "Tasks", "value": 100},
{"label": "Passed", "value": 75, "color": "success"},
]),
title="Summary",
)
# Render to file
builder.render_to_file("output.html")
Ready-to-Use Viewers
from openadapt_viewer.viewers.benchmark import generate_benchmark_html
# From benchmark results directory
generate_benchmark_html(
data_path="benchmark_results/run_001/",
output_path="viewer.html",
)
CLI Usage
# Generate demo benchmark viewer
openadapt-viewer demo --tasks 10 --output viewer.html
# Generate from benchmark results
openadapt-viewer benchmark --data results/run_001/ --output viewer.html
Components
| Component | Description |
|---|---|
screenshot_display |
Screenshot with click/highlight overlays |
playback_controls |
Play/pause/speed controls for step playback |
timeline |
Progress bar for step navigation |
action_display |
Format actions (click, type, scroll, etc.) |
metrics_card |
Single statistic card |
metrics_grid |
Grid of metric cards |
filter_bar |
Filter dropdowns with optional search |
selectable_list |
List with selection support |
badge |
Status badges (pass/fail, etc.) |
Project Structure
src/openadapt_viewer/
├── components/ # Reusable UI building blocks
│ ├── screenshot.py # Screenshot with overlays
│ ├── playback.py # Playback controls
│ ├── timeline.py # Progress bar
│ ├── action_display.py # Action formatting
│ ├── metrics.py # Stats cards
│ ├── filters.py # Filter dropdowns
│ ├── list_view.py # Selectable lists
│ └── badge.py # Status badges
├── builders/ # High-level page builders
│ └── page_builder.py # PageBuilder class
├── styles/ # Shared CSS
│ └── core.css # CSS variables and base styles
├── core/ # Core utilities
│ ├── types.py # Pydantic models
│ └── html_builder.py # Jinja2 utilities
├── viewers/ # Full viewer implementations
│ └── benchmark/ # Benchmark results viewer
├── examples/ # Reference implementations
│ ├── benchmark_example.py
│ ├── training_example.py
│ ├── capture_example.py
│ └── retrieval_example.py
└── templates/ # Jinja2 templates
Examples
Run the examples to see how different OpenAdapt packages can use the component library:
# Benchmark results (openadapt-evals)
python -m openadapt_viewer.examples.benchmark_example
# Training dashboard (openadapt-ml)
python -m openadapt_viewer.examples.training_example
# Capture playback (openadapt-capture)
python -m openadapt_viewer.examples.capture_example
# Retrieval results (openadapt-retrieval)
python -m openadapt_viewer.examples.retrieval_example
Development
# Clone and install
git clone https://github.com/OpenAdaptAI/openadapt-viewer.git
cd openadapt-viewer
uv sync --all-extras
# Run tests
uv run pytest tests/ -v
# Run linter
uv run ruff check .
Integration
Used by other OpenAdapt packages:
- openadapt-ml: Training dashboards and model comparison
- openadapt-evals: Benchmark result visualization
- openadapt-capture: Capture recording playback
- openadapt-retrieval: Demo search result display
License
MIT License - see LICENSE file for details.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openadapt_viewer-0.1.0.tar.gz.
File metadata
- Download URL: openadapt_viewer-0.1.0.tar.gz
- Upload date:
- Size: 94.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
445226d999be0a6edc1824bebaa2a02e2c178f5873212d96080ab8695959bedc
|
|
| MD5 |
b4fbda081932b70286f57e2537dbd9ee
|
|
| BLAKE2b-256 |
734508f499fee43ef8eb3c621f186301fa84902f57dae9f9da0a4c1e8dbab148
|
Provenance
The following attestation bundles were made for openadapt_viewer-0.1.0.tar.gz:
Publisher:
publish.yml on OpenAdaptAI/openadapt-viewer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openadapt_viewer-0.1.0.tar.gz -
Subject digest:
445226d999be0a6edc1824bebaa2a02e2c178f5873212d96080ab8695959bedc - Sigstore transparency entry: 832449492
- Sigstore integration time:
-
Permalink:
OpenAdaptAI/openadapt-viewer@bd4cbb0731922a623262c3338ebc970e926f2319 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/OpenAdaptAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bd4cbb0731922a623262c3338ebc970e926f2319 -
Trigger Event:
push
-
Statement type:
File details
Details for the file openadapt_viewer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openadapt_viewer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 55.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1397e192a21d9e80a877aa97dd8e90b79ecd623eb9080068618e86afd25501a0
|
|
| MD5 |
24cbebccf514c111e1adc2cbf7e8c15c
|
|
| BLAKE2b-256 |
d9f7c2eb224c6dee764cf7242972392da9f0dcd1e1dbde0d9947905a014718fc
|
Provenance
The following attestation bundles were made for openadapt_viewer-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on OpenAdaptAI/openadapt-viewer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openadapt_viewer-0.1.0-py3-none-any.whl -
Subject digest:
1397e192a21d9e80a877aa97dd8e90b79ecd623eb9080068618e86afd25501a0 - Sigstore transparency entry: 832449494
- Sigstore integration time:
-
Permalink:
OpenAdaptAI/openadapt-viewer@bd4cbb0731922a623262c3338ebc970e926f2319 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/OpenAdaptAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bd4cbb0731922a623262c3338ebc970e926f2319 -
Trigger Event:
push
-
Statement type: