How to avoid using exec() and eval() in Python
You can use getattr, setattr and delattr to retrieve, modify and remove attributes respectively. This avoids most potential messes eval has.
input_files_dict = json.loads(cfg.get(&quot;service_info&quot;, &quot;file_inputs&quot;))
for key, val in input_files_dict.items():
    setattr(self, key, self.post_data(f'{value}'))