def dotget(root, path: str, default=None) -> object:
    """ Access an item in the root field via a dot path.
    Arguments:
    - root: Object to access via dot path.
    - path: Every dot path should be relative to the state property.
    - default: Default value if path doesn't exist.

    Returns: Value. If path does not exist default is returned.
    """
    parts = path.split('.')

    for part in parts:
        try:
            if type(root) is list:
                root = root[int(part)]
            else:
                root = root[part]
        except KeyError:
            return default

    return root