models
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| ActivitySample framesheet.models One dense video sample: share of pixels changed since the previous sample. |
||
| AnimationTiming framesheet.models Timing of one declarative animation, as reported by the browser. |
||
| DurationInfo framesheet.models The sampled time span and how it was chosen. |
||
| ElementTrack framesheet.models Geometry of one animated element over all frames. |
||
| Finding framesheet.models A single problem (or noteworthy fact) found by a static or render check. |
||
| FrameMetrics framesheet.models Per-frame numbers. |
||
| Images framesheet.models |
||
| InspectionResult framesheet.models Everything framesheet found out about one input. |
||
| LoopInfo framesheet.models How cleanly the last frame of a cycle joins the first. |
||
| MarkFrame framesheet.models Pixel size the coordinates refer to (omit for normalized 0-1 coordinates). |
||
| MarkPoint framesheet.models An instant at a position, e.g. a click: drawn on the tile nearest to ``t``. |
||
| MarkRegion framesheet.models A time range, optionally with a box: a target element, a zoom, a highlight. |
||
| MarkSpan framesheet.models A labelled time range, e.g. a caption; the optional box is its screen area. |
||
| Marks framesheet.models Annotations drawn onto video tiles and the timeline (``--marks marks.json``). |
||
| VideoInfo framesheet.models Media facts and dense-sample metrics of a video or animated image. |
||
| VideoTile framesheet.models Per-tile numbers for videos, so an agent can score without looking. |
🛈 DocStrings¶
Result models for framesheet inspections.
FINDING_CODES
module-attribute
¶
FINDING_CODES: dict[str, tuple[Severity, Literal["static", "render"], str]] = {
"malformed-xml": ("error", "static", "The SVG is not well-formed XML."),
"not-svg": ("error", "static", "The root element is not <svg>."),
"missing-xmlns": ("error", "static", "The root <svg> lacks the SVG namespace."),
"missing-viewbox": ("error", "static", "The root <svg> has no viewBox."),
"missing-title": ("warning", "static", "No aria-label or <title>."),
"script": ("error", "static", "Contains <script>."),
"foreign-object": ("warning", "static", "Contains <foreignObject>."),
"event-handler": ("error", "static", "Inline on* event handler attribute."),
"external-url": ("warning", "static", "External http(s) URL in an attribute."),
"positive-begin": ("warning", "static", "<animateMotion> with a positive begin."),
"duplicate-id": ("error", "static", "The same id is used more than once."),
"broken-ref": ("error", "static", "#id / url(#id) reference without a matching id."),
"css-external": ("warning", "static", "CSS references an external URL or font."),
"no-reduced-motion": ("warning", "static", "CSS animations without prefers-reduced-motion."),
"transform-origin-without-box": (
"warning",
"static",
"CSS transform-origin without transform-box in SVG.",
),
"transform-without-box": (
"warning",
"static",
"@keyframes animate transforms in SVG without transform-box.",
),
"large-file": ("warning", "static", "SVG larger than 100 KB."),
"parked-at-origin": ("warning", "render", "Small SVG element sits at the origin (0,0)."),
"outside-bounds": ("warning", "render", "Element extends outside the viewBox/viewport."),
"text-overflow": ("warning", "render", "Text larger than its container."),
"svg-transform-box": (
"warning",
"render",
"CSS transform animation pivots around the SVG origin.",
),
"non-seamless-loop": ("warning", "render", "The loop jumps at the cycle end."),
"js-driven-motion": ("warning", "render", "Pixels change without declarative animations."),
"no-visible-motion": ("info", "render", "Animations declared but no pixel changed."),
"no-motion": ("info", "render", "No animation and no pixel change."),
"console-error": ("warning", "render", "console.error or uncaught page error."),
"video-static-stretch": (
"warning",
"render",
"No visible change for longer than the static threshold (dead time).",
),
"video-black-frames": ("warning", "render", "Sampled frames that are (almost) all black."),
"video-blank-frames": ("warning", "render", "Sampled frames of one flat colour (not black)."),
"video-abrupt-cut": ("info", "render", "One large change between quiet neighbours."),
"video-mark-overlap": (
"warning",
"render",
"A span box (e.g. a caption) covers an active target region.",
),
}
Every finding code (API: stable, kebab-case) -> (usual severity, check, meaning).
Both implementations (Python and npm) may only emit these; the shared JSON Schema
(schema/report.schema.json) pins them as an enum. Add new codes here first.
Rect
module-attribute
¶
An axis-aligned box as (x, y, width, height).
ActivitySample
¶
AnimationTiming
¶
Bases: BaseModel
Timing of one declarative animation, as reported by the browser.
Source code in src/framesheet/models.py
DurationInfo
¶
Bases: BaseModel
The sampled time span and how it was chosen.
Source code in src/framesheet/models.py
looping
instance-attribute
¶
True if at least one animation repeats forever (or motion is JS-driven).
ElementTrack
¶
Bases: BaseModel
Geometry of one animated element over all frames.
Source code in src/framesheet/models.py
Finding
¶
Bases: BaseModel
A single problem (or noteworthy fact) found by a static or render check.
Source code in src/framesheet/models.py
FrameMetrics
¶
Bases: BaseModel
Per-frame numbers.
Source code in src/framesheet/models.py
changed_box
class-attribute
instance-attribute
¶
changed_box: Rect | None = None
Bounding box (CSS px) of the pixels that changed vs. the previous frame.
changed_ratio
instance-attribute
¶
Share of pixels that differ from the previous frame (0 for the first frame).
path
class-attribute
instance-attribute
¶
Path of the individual frame PNG, if frames were kept.
InspectionResult
¶
Bases: BaseModel
Everything framesheet found out about one input.
Source code in src/framesheet/models.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | |
canvas
instance-attribute
¶
canvas: Rect
Drawing area in CSS px (the viewBox for SVG documents, the viewport for HTML).
marks
class-attribute
instance-attribute
¶
marks: Marks | None = None
The marks drawn onto the sheet (--marks), as given.
video
class-attribute
instance-attribute
¶
video: VideoInfo | None = None
Media facts and per-tile metrics (video inputs only).
codes
¶
summary
¶
Concise multi-line text for humans and agents (what the CLI prints).
Source code in src/framesheet/models.py
LoopInfo
¶
Bases: BaseModel
How cleanly the last frame of a cycle joins the first.
Source code in src/framesheet/models.py
MarkFrame
¶
Bases: BaseModel
Pixel size the coordinates refer to (omit for normalized 0-1 coordinates).
Source code in src/framesheet/models.py
MarkPoint
¶
Bases: BaseModel
An instant at a position, e.g. a click: drawn on the tile nearest to t.
Source code in src/framesheet/models.py
MarkRegion
¶
Bases: _Box
A time range, optionally with a box: a target element, a zoom, a highlight.
Source code in src/framesheet/models.py
kind
class-attribute
instance-attribute
¶
Free-form, e.g. zoom. target boxes are checked against span boxes.
MarkSpan
¶
Bases: _Box
A labelled time range, e.g. a caption; the optional box is its screen area.
Source code in src/framesheet/models.py
Marks
¶
Bases: BaseModel
Annotations drawn onto video tiles and the timeline (--marks marks.json).
Times are seconds of the media; coordinates are fractions (0-1) of the video frame,
or pixels of frame if given.
Source code in src/framesheet/models.py
norm
¶
VideoInfo
¶
Bases: BaseModel
Media facts and dense-sample metrics of a video or animated image.
Source code in src/framesheet/models.py
codec
instance-attribute
¶
h264, hevc, vp8, vp9, av1, gif, webp, ... if detectable.
samples
instance-attribute
¶
samples: list[ActivitySample]
Every sampled time in [start, end] (tiles + dense grid), in order.
static_threshold
instance-attribute
¶
Seconds without visible change that count as a static stretch.
VideoTile
¶
Bases: BaseModel
Per-tile numbers for videos, so an agent can score without looking.
Source code in src/framesheet/models.py
blank
instance-attribute
¶
One flat colour that is not black (e.g. a white page before load).
duplicate
instance-attribute
¶
Near-identical to the previous tile (changes < 0.05% of pixels).
media_time
instance-attribute
¶
Presentation time of the decoded frame (None if the browser did not say).
sharpness
instance-attribute
¶
Mean luma gradient (0-510); compare tiles of one video: drops = blur/upscaling.
as_rect
¶
as_rect(values: Sequence[float]) -> Rect
Coerce a 4-item sequence (e.g. a JSON list from the page) to a :data:Rect.
marks_schema
¶
JSON Schema of marks.json (--marks), shared with the npm package (schema/).
Cross-field rules (box all-or-none, end >= start, coordinates inside the frame)
are enforced by both implementations' validators and documented in the description.
Source code in src/framesheet/models.py
report_schema
¶
JSON Schema of report.json, shared with the npm package (schema/).
Generated from :class:InspectionResult in serialization mode; every object is closed
(additionalProperties: false) and every field required, because both
implementations always write all fields (null for unset ones).