from typing import OrderedDict


def _as_dict(parser):
    """
    Go over all sections in the parser,
    convert's there's key/value as dictionary that
    for every section in the parser has dictionary
    with key/value pairs (both str).

    :param parser: (self)
    :return: dict with key/value as str
    """
    d = OrderedDict()
    for section in parser.sections():
        d[section] = OrderedDict()
        for key in parser.options(section):
            d[section][key] = parser.get(section, key)
    return d