class SymbolDict(object):

    def __init__(self, **kwargs):
        for key in kwargs:
            setattr(self, key, kwargs[key])
x = SymbolDict(foo=1, bar='3')
assert x.foo == 1
How can you set class attributes from variable arguments (kwargs) in python