pyphi.serialize.convert#

Convert between PyPhi domain objects and their msgspec schema Structs.

Two registries map a domain type to its encoder and a schema Struct type to its decoder. Each serializable type adds one _register_<type>() populating both registries, invoked on first use via _ensure_registered().

Functions

decode_document(payload, frame[, node_labels])

Decode payload under a document label frame.

encode_document(obj)

Encode obj to a payload struct plus the claimed label frame.

from_schema(struct)

to_schema(obj)