itacart.index.parse

itacart.index.parse(index)[source]

Parse an index string into a nested structural tree.

The tree is the shared substrate for hierarchy, topology and serialization; most callers want decompose() instead.

Every node carries code, resolution and children. The root is the globe — resolution -1 and code None — and carries two further keys: quadrant and base_cell, each holding the one code when the index has exactly one and None when it addresses several. base_cell is the bare X/Y component, not the qualified form that base_cell_of() returns.

Parameters:

index (str) – Compositional index string.

Return type:

dict[str, object]

Returns:

A nested mapping with quadrant, base_cell and children.

Raises:

InvalidIndexError – On malformed syntax, unbalanced parentheses, or a refinement code outside the alphabet of its resolution.