def extract_p(path, dict_obj, default):
    """
    try to extract dict value in key path, if key error provide default
    :param path: the nested dict key path, separated by '.'
    (therefore no dots in key names allowed)
    :param dict_obj: the dictinary object from which to extract
    :param default: a default return value if key error
    :return: extracted value
    """
    if dict_obj is None:
        return default

    keys = path.split('.')
    tmp_iter = dict_obj
    for key in keys:
        try:
            # dict.get() might make KeyError exception unnecessary
            tmp_iter = tmp_iter.get(key, default)
        except KeyError:
            return default
    return tmp_iter