def dict_to_object(dick): # http://stackoverflow.com/a/1305663/968442 class Struct: def __init__(self, **entries): self.__dict__.update(entries) return Struct(**dick)
If one decides to permanently convert that dict
to object this should do. You can create a throwaway object just before accessing.
d = dict_to_object(d)