class Struct(dict):

    def __getattr__(self, name):
        return self[name]

def __setattr__(self, name, value):
    self[name] = value

def __delattr__(self, name):
    del self[name]
j = '{"y": [2, 3, {"a": 55, "b": 66}], "x": 4}'
aa = json.loads(j, object_hook=Struct)
for i in aa.y:
    pass
использование ключей JSON в качестве атрибутов python во вложенном JSON