itacart.serialization.data_tree_blob.data_tree_schema

itacart.serialization.data_tree_blob.data_tree_schema(blob)[source]

What a DataTreeBlob declares, read from its frame.

Parameters:

blob (Union[bytes, bytearray, memoryview]) – The bytes.

Return type:

dict[str, Any]

Returns:

resolution (the observation resolution), deepest (the finest level holding nodes), pruned (whether the writer folded families into blocks), variables (a tuple of DataVariable) and nodes (the node count per level).

Raises:

Example

>>> n = DataVariable("n", "u32", op="sum", leaf_max=1)
>>> blob = encode_data_tree({"NE(0625/0451(3))": {"n": 1}}, [n])
>>> data_tree_schema(blob)["nodes"]
(1, 1, 1)