GUI interaction capture - platform-agnostic event streams with time-aligned media
Project description
openadapt-capture
GUI interaction capture - platform-agnostic event streams with time-aligned media.
Status: Pre-alpha. See docs/DESIGN.md for architecture discussion.
Installation
uv add openadapt-capture
This includes everything needed to capture and replay GUI interactions (mouse, keyboard, screen recording).
For audio capture with Whisper transcription (large download):
uv add "openadapt-capture[audio]"
Quick Start
Capture
from openadapt_capture import Recorder
# Record GUI interactions
with Recorder("./my_capture", task_description="Demo task") as recorder:
# Captures mouse, keyboard, and screen until context exits
input("Press Enter to stop recording...")
print(f"Captured {recorder.event_count} events")
Replay / Analysis
from openadapt_capture import Capture
# Load and iterate over time-aligned events
capture = Capture.load("./my_capture")
for action in capture.actions():
# Each action has an associated screenshot
print(f"{action.timestamp}: {action.type} at ({action.x}, {action.y})")
screenshot = action.screenshot # PIL Image at time of action
Low-Level API
from openadapt_capture import (
create_capture, process_events,
MouseDownEvent, MouseButton,
)
# Create storage (platform and screen size auto-detected)
capture, storage = create_capture("./my_capture")
# Write raw events
storage.write_event(MouseDownEvent(timestamp=1.0, x=100, y=200, button=MouseButton.LEFT))
# Query and process
raw_events = storage.get_events()
actions = process_events(raw_events) # Merges clicks, drags, typed text
Event Types
Raw events (captured):
mouse.move,mouse.down,mouse.up,mouse.scrollkey.down,key.upscreen.frame,audio.chunk
Actions (processed):
mouse.singleclick,mouse.doubleclick,mouse.dragkey.type(merged keystrokes → text)
Architecture
capture_directory/
├── capture.db # SQLite: events, metadata
├── video.mp4 # Screen recording
└── audio.flac # Audio (optional)
Performance Statistics
Track event write latency and analyze capture performance:
from openadapt_capture import Recorder
with Recorder("./my_capture") as recorder:
input("Press Enter to stop...")
# Access performance statistics
summary = recorder.stats.summary()
print(f"Mean latency: {summary['mean_latency_ms']:.1f}ms")
# Generate performance plot
recorder.stats.plot(output_path="performance.png")
Frame Extraction Verification
Compare extracted video frames against original images to verify lossless capture:
from openadapt_capture import compare_video_to_images, plot_comparison
# Compare frames
report = compare_video_to_images(
"capture/video.mp4",
[(timestamp, image) for timestamp, image in captured_frames],
)
print(f"Mean diff: {report.mean_diff_overall:.2f}")
print(f"Lossless: {report.is_lossless}")
# Visualize comparison
plot_comparison(report, output_path="comparison.png")
Visualization
Generate animated demos and interactive viewers from recordings:
Animated GIF Demo
from openadapt_capture import Capture, create_demo
capture = Capture.load("./my_capture")
create_demo(capture, output="demo.gif", fps=10, max_duration=15)
Interactive HTML Viewer
from openadapt_capture import Capture, create_html
capture = Capture.load("./my_capture")
create_html(capture, output="viewer.html", include_audio=True)
The HTML viewer includes:
- Timeline scrubber with event markers
- Frame-by-frame navigation
- Synchronized audio playback
- Event list with details panel
- Keyboard shortcuts (Space, arrows, Home/End)
Generate Demo from Command Line
uv run python scripts/generate_readme_demo.py --duration 10
Optional Extras
| Extra | Features |
|---|---|
audio |
Audio capture + Whisper transcription |
privacy |
PII scrubbing (openadapt-privacy) |
all |
Everything |
Development
uv sync --dev
uv run pytest
License
MIT
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
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_capture-0.1.0.tar.gz.
File metadata
- Download URL: openadapt_capture-0.1.0.tar.gz
- Upload date:
- Size: 10.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5d02a126d2bfe3bd6920c0fb25f854e615d88a374a5724991026e09d89ac6bf
|
|
| MD5 |
a5c7daf60dbcee2cdb6936719cd5bcf9
|
|
| BLAKE2b-256 |
60e8a13c79c72aaa441d6bebf14f0da52a0fcad7785925dd9540ec8700b472b1
|
Provenance
The following attestation bundles were made for openadapt_capture-0.1.0.tar.gz:
Publisher:
publish.yml on OpenAdaptAI/openadapt-capture
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openadapt_capture-0.1.0.tar.gz -
Subject digest:
a5d02a126d2bfe3bd6920c0fb25f854e615d88a374a5724991026e09d89ac6bf - Sigstore transparency entry: 762931942
- Sigstore integration time:
-
Permalink:
OpenAdaptAI/openadapt-capture@eda29a49124d6db70369db518ae734ff0b994cec -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/OpenAdaptAI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@eda29a49124d6db70369db518ae734ff0b994cec -
Trigger Event:
push
-
Statement type:
File details
Details for the file openadapt_capture-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openadapt_capture-0.1.0-py3-none-any.whl
- Upload date:
- Size: 57.9 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 |
229e6d762dcfe22a34655853b5cf7c9eb08a61238cc79eefdffcf01f0c3dc860
|
|
| MD5 |
a5b47a79b41e1fd1c1b2bf917eb8bf30
|
|
| BLAKE2b-256 |
c4a8f08d2fb482dc64443ae7208f9616b994b74b63f052737373f9fc32eb0ead
|
Provenance
The following attestation bundles were made for openadapt_capture-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on OpenAdaptAI/openadapt-capture
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openadapt_capture-0.1.0-py3-none-any.whl -
Subject digest:
229e6d762dcfe22a34655853b5cf7c9eb08a61238cc79eefdffcf01f0c3dc860 - Sigstore transparency entry: 762931954
- Sigstore integration time:
-
Permalink:
OpenAdaptAI/openadapt-capture@eda29a49124d6db70369db518ae734ff0b994cec -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/OpenAdaptAI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@eda29a49124d6db70369db518ae734ff0b994cec -
Trigger Event:
push
-
Statement type: