def read_path_dict(dict_like, path):
    """
    Resolves an non-recursive jsonpath like string over a given dictionary

    # Arguments
    dict_like: Mapping, Lookup dictionary
    path: String, lookup path, e.g. path.to[key].foo

    # Examples
    ```python
    read_path_dict({'foo': {'bar': 42}}, 'foo.bar')
    >>> 42
    ```

    # Raises
    KeyError
    """
    path = path.replace('][', '].[')
    segments = path.split('.')
    current = dict_like
    for segment in segments:
        if segment.find('[') >= 0:
            key = segment[segment.find('[') + 1:-1]
            if key.isdigit():
                key = int(key)
            if not segment.startswith('['):
                current = current[segment[:segment.find('[')]]
            current = current[key]
        else:
            current = current[segment]
    return current
