Plush

Project#

plupy · Type index

Module: plupy · obtained from plupy.Project.open(path, executable)

A read-only project snapshot from an external process (plupy.Project.open(path, executable)).

path: project directory/package. executable: path to the Plush editor executable, not a Python executable. Calls --project-snapshot and waits up to 60 seconds.

Project memberType / result
generationint; snapshot generation
datablockstuple[Datablock, ...]
typestuple[tuple[str, tuple[Property, ...]], ...]; registered schemas
of_type(kind)Tuple of datablocks whose type exactly matches kind
properties_for(kind)Tuple of schema properties; empty if missing
sprite_budget(limit_bytes=4194304)Tuple of diagnostic dictionaries for sprites exceeding the decoded-byte budget
Project.from_snapshot(snapshot)Parse a version-1 project snapshot dictionary

Datablock fields: id, type, name, path (str); source (str | None); embedded (bool); width, height, decodedBytes (int | None); users, dependencies (tuple[str, ...]). These are copies, not editable DataBlock handles.

Property fields: key, label, kind (str), targetType (str | None). Budget diagnostic keys: checkId, severity, targetId, generation, message.

@dataclass(frozen=True)
class Project

Usage and examples

Members: generation · datablocks · types · open · from_snapshot · properties_for · of_type · sprite_budget

generation#

generation: int

datablocks#

datablocks: tuple[Datablock, ...]

types#

types: tuple[tuple[str, tuple[Property, ...]], ...] = ()

open#

open(path, executable)

Run the editor's --project-snapshot on a project and parse the result (waits up to 60 seconds). executable is the Plush editor, not a Python executable.

from_snapshot#

from_snapshot(snapshot)

Parse a version-1 project snapshot dictionary.

properties_for#

properties_for(kind)

The registered schema properties of a datablock kind, or an empty tuple.

of_type#

of_type(kind)

The datablocks whose type equals kind.

sprite_budget#

sprite_budget(limit_bytes=4 * 1024 * 1024)

Diagnostic dicts (checkId, severity, targetId, generation, message) for sprites whose decoded size exceeds limit_bytes.

DataBlock · Datablock · Property

Source#