@staticmethod
    def dictify_history_entry(entry):
        output = entry.attrib
        fields = {}
        for field in entry:
            kind = field.attrib['name']
            if kind != 'last_modified':
                fields[kind] = {'old_value': field.attrib['old_value'],
                                'new_value': field.attrib['new_value']}
        output['fields'] = fields
        return output
Turn XML history into a dictionary
dataset/ETHPy150Open MediaMath/t1-python/terminalone/xmlparser.py/XMLParser.dictify_history_entry