class allMyFields(object):
    Field1 = None
Field2 = None

def __init__(self, dictionary):
    self.__dict__.update(dictionary)
q = {'Field1': 3000, 'Field2': 6000, 'RandomField': 5000}
instance = allMyFields(q)
print(instance.Field1)
print(instance.Field2)
print(instance.RandomField)
Creating class instance properties from a dictionary in Python