API reference#
Everything a user is allowed to depend on is named in scenet.__all__ and imported
straight from the top level:
from scenet import compile_source, render
result = compile_source("cast: {a: {reference: alice}}")
svg = render(result.core)
Each public name has an entry of its own: a card with its import line, the module that defines it, what to install and the release it appeared in, then its signature, what it does, what it raises, its limits, an example and where to look next.
The public surface at a glance#
Guarantees#
What holds for every public name: what stays stable, what is deterministic, what threads may share, which files a compile reads, and how long it takes. See Guarantees.
Types the API returns and takes#
Some types reach you without being in scenet.__all__:
The Panel Core types,
CoreActor,CoreBalloon,CoreFrameand the rest, are what you read offresult.coreandbook.pages. They have a page of their own. Import one fromscenet.coreto annotate with it; its fields are the Panel Core format’s, and change only as the format does.base=, on the functions that compile text, takes a folder: apathlib.Path, or a mapping of each file’s relative path to its bytes. Its type is the aliasscenet.paths.Folder; you never need to name it.
Types#
Scenet ships a py.typed marker, so mypy, pyright, ty and basedpyright read these
annotations directly from the installed package. No stubs to install, nothing to
configure.
Internals#
Names outside __all__ are internal. They are still documented here, by the module that
defines them – the decisions inside the solver are the interesting part of this project –
but they are outside semantic versioning: a minor release may rename, move or remove
any of them without notice.
Internals
- Compiling
- The language
- Frontends
- Panel Core
- Geometry
- Characters
- Solving
- Emitting
scenet.emit.svgscenet.emit.geometryscenet.emit.marksscenet.emit.pdfscenet.emit.pdf_fontsscenet.emit.pdf_imagesscenet.emit.turbulencescenet.emit.cmykscenet.emit.debug_svgscenet.emit.stripscenet.emit.pagescenet.emit.conditioningscenet.emit.posescenet.emit.boxesscenet.emit.semanticsscenet.emit.depthscenet.emit.maskscenet.emit.exportscenet.emit.preview
- Errors
- Command line
- Agent-facing surface