Metadata-Version: 2.5
Name: aidancevideo-replay-windows
Version: 0.1.0
Summary: Validate local video replay windows and export their timestamps as CSV.
Project-URL: Homepage, https://ai-dance-video.com
License-Expression: LicenseRef-NoLicenseGrant
License-File: LICENSE
Keywords: replay,time-window,validation,video
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# aidancevideo-replay-windows

Track the start and end of a video replay window while source metadata loads asynchronously. Each selected source receives a revision. An operation that arrives with an older revision leaves the new source intact.

## Example

    from aidancevideo_replay_windows import WindowSession, format_window_csv

    session = WindowSession(minimum_window=0.25)
    revision = session.begin_source()
    session.accept_metadata(revision, 3.0)
    session.set_marker(revision, "start", 0.5)
    session.set_marker(revision, "end", 1.25)
    print(format_window_csv(session.snapshot()), end="")

This prints one CSV data row with the start and end seconds. The export contains only timestamps. Values use Python's float representation and may use scientific notation for very small intervals.

## Integrate with a player

Call begin_source before reading a newly selected file, and retain that revision in the callback or task that delivers metadata. accept_metadata accepts positive finite durations. set_marker accepts finite seconds from zero through that duration. Both methods return False when the revision or value is invalid.

A new source clears duration and markers. Accepted metadata also clears markers, so callers should submit it once per metadata result. The snapshot is frozen and derives its valid state from the range and minimum length. Reverse or short ranges can be retained while the user adjusts them. format_window_csv raises ValueError until the range is valid.

Use a caller-selected minimum duration when the default quarter second is unsuitable. The threshold uses floating-point seconds. Connect this model to the player's own metadata, error, seek, playback and cleanup events. It validates numeric state and has no media decoder or playback scheduler.

## Scope

This standalone Python port adapts the AIDanceVideo team's replay-window teaching model. The separate AIDanceVideo browser generator provides product context. The module takes numerical inputs and makes no service or network calls. AI assistance was used for the code and documentation.

Python 3.10 or newer is required. The package has no runtime dependencies. The distribution metadata declares LicenseRef-NoLicenseGrant and includes the notice in LICENSE.
