class DictToStruct: def __init__(self, **entries): self.__dict__.update(entries) struct = DictToStruct(**temp)