framesheet
Class info¶
Re-exported classes¶
| Class | Module | Description |
|---|---|---|
| AnimationTiming | framesheet.models | Timing of one declarative animation, as reported by the browser. |
| BrowserNotInstalledError | framesheet.render | Raised when Playwright's Chromium is missing. |
| 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. |
🛈 DocStrings¶
framesheet: main package.
Frame-accurate contact sheets and motion maps for animated SVG and HTML, for humans and AI agents.
AnimationTiming
¶
Bases: BaseModel
Timing of one declarative animation, as reported by the browser.
Source code in src/framesheet/models.py
BrowserNotInstalledError
¶
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
inspect
¶
inspect(
source: str | Path,
*,
frames: int = 12,
duration: float | None = None,
size: tuple[int, int] | None = None,
scale: float | None = None,
at: float | None = None,
out: str | Path | None = None,
tile: int | None = None,
columns: int | None = None,
keep_frames: bool = False,
heat_frames: int = 48,
color_scheme: ColorScheme = "light",
timeout: float = 30.0,
every: float | None = None,
times: Sequence[float] | Literal["marks"] | None = None,
start: float | None = None,
end: float | None = None,
marks: str | Path | dict[str, Any] | Marks | None = None,
static_stretch: float = 2.0,
channel: str | None = None,
) -> InspectionResult
Render an animated SVG/HTML (or a video) at evenly spaced times and check it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str | Path
|
Path to an |
required |
frames
|
int
|
Number of contact-sheet tiles (2-100), spread over one cycle. |
12
|
duration
|
float | None
|
Cycle length in seconds; detected from SMIL/CSS/Web Animations if omitted. |
None
|
size
|
tuple[int, int] | None
|
Viewport |
None
|
scale
|
float | None
|
Device scale factor (default 1; tiny SVGs without |
None
|
at
|
float | None
|
Time in seconds of the full-resolution frame |
None
|
out
|
str | Path | None
|
Output directory (default: a new temporary directory). |
None
|
tile
|
int | None
|
Longest side of a contact-sheet tile in px (default: fit 1568 px width). |
None
|
columns
|
int | None
|
Contact-sheet columns (default: roughly 4:3 sheet). |
None
|
keep_frames
|
bool
|
Also write every sampled frame to |
False
|
heat_frames
|
int
|
Extra evenly spaced frames (pixels only) for a continuous heatmap trail; 0 uses only the contact-sheet frames. |
48
|
color_scheme
|
ColorScheme
|
|
'light'
|
timeout
|
float
|
Seconds to wait for navigation and page scripts. |
30.0
|
every
|
float | None
|
Videos: one tile every this many seconds (instead of |
None
|
times
|
Sequence[float] | Literal['marks'] | None
|
Videos: explicit tile times (seconds), or |
None
|
start
|
float | None
|
Videos: start of the inspected range (default 0). |
None
|
end
|
float | None
|
Videos: end of the inspected range (default: the media duration). |
None
|
marks
|
str | Path | dict[str, Any] | Marks | None
|
Videos: marks to draw (path, JSON string, dict or :class: |
None
|
static_stretch
|
float
|
Videos: seconds without visible change reported as
|
2.0
|
channel
|
str | None
|
Browser channel for Playwright (e.g. |
None
|
Returns:
| Type | Description |
|---|---|
InspectionResult
|
Paths of the written images plus metrics and findings. |
Source code in src/framesheet/core.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |
install_browser
¶
Install Playwright's Chromium for the running Python environment.