Rename fields

        :param mapping: a dict in the format {'oldkey1': 'newkey1', ...}

def rename(self, mapping):
        """
        Rename fields

        :param mapping: a dict in the format {'oldkey1': 'newkey1', ...}
        """
        for old_key, new_key in mapping:
            self.dict[new_key] = self.dict[old_key]
            del self.dict[old_key]