load_script#

Import

from scenet import load_script

Defined in

scenet.frontends.script_front (source)

Install

pip install scenet

Since

0.1

Stability

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

scenet.frontends.script_front.load_script(path)[source]#

Read and validate a comic script from disk.

Parameters:

path (Path) – A *.script file in the comic-script format writers already use.

Return type:

dict[str, PanelIR]

Returns:

Panel name to scene graph, in the order the panels appear.

Raises:

Note

Only the script is read; files its front matter names are read when it is compiled.

Example

>>> from pathlib import Path
>>> from tempfile import TemporaryDirectory
>>> from scenet import load_script
>>> with TemporaryDirectory() as folder:
...     path = Path(folder) / "one.script"
...     _ = path.write_text(
...         "---\ncast: {ALICE: {reference: alice}}\n---\nPANEL 1\n\nALICE\nHi.\n",
...         encoding="utf-8",
...     )
...     panels = load_script(path)
>>> len(panels)
1

See also

parse_script, for text.