load_scene_document#

Import

from scenet import load_scene_document

Defined in

scenet.frontends.yaml_front (source)

Install

pip install scenet

Since

0.10

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

scenet.frontends.yaml_front.load_scene_document(path)[source]#

Read a scene and the pages it is laid out on, from disk.

Parameters:

path (Path) – A *.scene.yaml file, or any YAML document the frontend reads.

Return type:

SceneDocument

Returns:

The panels and the layout.

Raises:

Note

Nothing is laid out; the pages are validated against the panels only.

Example

>>> from pathlib import Path
>>> from tempfile import TemporaryDirectory
>>> from scenet import load_scene_document
>>> with TemporaryDirectory() as folder:
...     path = Path(folder) / "page.scene.yaml"
...     _ = path.write_text(
...         "cast: {a: {reference: alice}}\n"
...         "panels: {one: {}}\npages: [{tiers: [{panels: [one]}]}]",
...         encoding="utf-8",
...     )
...     document = load_scene_document(path)
>>> len(document.layout.pages)
1

See also

parse_scene_document, for text.