def from_object(self, obj):
        for key in dir(obj):
            if key.isupper():
                val = getattr(obj, key)
                setattr(self, key, val)

        return self
Copy uppercase attributes from another object to this one
dataset/ETHPy150Open openelections/openelections-core/openelex/config.py/Settings.from_object