sources
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| Source framesheet.sources A resolved input. |
🛈 DocStrings¶
Input handling: files, stdin snippets and URLs.
VIDEO_ORIGIN
module-attribute
¶
Video wrapper pages and media are served from this virtual (secure) origin.
Source
dataclass
¶
A resolved input.
Source code in src/framesheet/sources.py
container
class-attribute
instance-attribute
¶
Video container (mp4, webm, gif, ...) for video sources.
media
class-attribute
instance-attribute
¶
Video/animated image bytes (kind == "video"), served to the wrapper page.
text
instance-attribute
¶
Source text if available locally (used for static checks and size detection).
fetch_bytes
¶
Download a video URL (errors are raised: there is nothing to inspect without it).
Source code in src/framesheet/sources.py
fetch_text
¶
Best-effort download of a URL's body (for static checks and SVG size detection).
Source code in src/framesheet/sources.py
parse_size
¶
Parse WxH (e.g. 1280x720).
Source code in src/framesheet/sources.py
resolve
¶
resolve(source: str | Path, workdir: Path) -> Source
Turn a path, - (stdin) or URL into a :class:Source.
Stdin snippets are written to workdir so they load as real documents.
Source code in src/framesheet/sources.py
snippet
¶
snippet(text: str, workdir: Path, *, label: str = '<snippet>') -> Source
Wrap an in-memory SVG/HTML snippet as a source (written to workdir).
Source code in src/framesheet/sources.py
svg_size
¶
Intrinsic size of an SVG: absolute width/height attributes, else the viewBox.
Source code in src/framesheet/sources.py
video_source
¶
video_source(label: str, data: bytes, container: str | None = None) -> Source
A video/animated image, played in a wrapper page on :data:VIDEO_ORIGIN.