import configparser


def parse_ini_config(filepath):
    """
    Parse INI file containing cameras definitions
    """

    parser = configparser.ConfigParser()
    parser.read(filepath)

    cams = {}
    for cam in parser.sections():
        cams[cam] = {
            "url": parser.get(cam, "url"),
            "username": parser.get(cam, "username", fallback=None),
            "password": parser.get(cam, "password", fallback=None),
        }

    return cams