A python class for a nested dictionaries representation of quads and triples