def id2func(self, id_): resp = requests.get(self.path + "/id_to_func", params={"id":id_}) # resp is a json snippet return bson_loads(resp.text)