pyphi.serialize#

Typed, compact (de)serialization of PyPhi results via msgspec.

Supports two wire formats from one schema: "json" (default, readable structure) and "msgpack" (binary, compact). The document carries a single top-level format_version and a node-labels frame written once per document: nested objects whose labels match the frame store none and inherit it on decode. A path ending in .gz is transparently gzip-compressed on save and decompressed on load.

Functions

dumps(obj, *[, format])

load(target, *[, format])

Deserialize a PyPhi domain object from target.

loads(data, *[, format, node_labels])

Deserialize a document produced by dumps().

save(obj, target, *[, format])

Serialize obj to target.

Submodules

arrays

Exact, compact serialization of numpy arrays as .npy bytes.

convert

Convert between PyPhi domain objects and their msgspec schema Structs.

frames

Exact serialization of pandas DataFrames as embedded parquet.

schema

msgspec schema types for serializing PyPhi results.