import jsonfrom collections import namedtupledef json2Object(jsonObj): return json.loads(jsonObj, object_hook=lambda d: namedtuple('jsonMain', d.keys())(*d.values()))