Делаете такой класс -
https://goodcode.io/articles/python-dict-object/class objdict(dict):
def __getattr__(self, name):
if name in self:
return self[name]
else:
raise AttributeError("No such attribute: " + name)
def __setattr__(self, name, value):
self[name] = value
def __delattr__(self, name):
if name in self:
del self[name]
else:
raise AttributeError("No such attribute: " + name)
Ну и далее
good_fileds = set(["actors", "composers", "counties", "directors", "genres", "id", "producers", "profit_russia",
"profit_usa", "profit_world", "rating", "scenarios", "title", "title_original", "trailers", "year"])
keys = good_fileds.intersection(movie.__dict__)
result = objdict({k: movie.__dict__.get(k) for k in keys})
result.rating
result.actors