def _expand_string_into_dict(string, value, sep='.'):
    """
    Converts a encapsulated string-dict to a sequence of dict. Use separator (default '.') to split the string.
    Example:
        string1.string2.stringN : value  -> {string1: {string2: {string3: value}}

    :param string: The encapsulated "string-dict"
    :param value: Value associated to the last field of the "string-dict"
    :param sep: Separator character. Default: '.'
    :rtype: dict
    """
    if sep not in string:
        return {string: value}
    key, val = string.split(sep, 1)
    return {key: _expand_string_into_dict(val, value)}