def show(cls, request: CkanRequest, id): query = {"id": id} response = request.gets("package_show", query=query) result = response.pop("result") package_instance = cls(result) return package_instance
def show(cls, request: CkanRequest, id: str): query = {"id": id} response = request.gets("tag_show", query=query) result = response.pop("result") tag_instance = cls(result) return tag_instance
def search(cls, request: CkanRequest, name: str): query = {"q": name} response = request.gets("package_search", query=query) results = response.get("result").pop("results") packages = list() for result in results: package_instance = cls(result) packages.append(package_instance) return packages
def search(cls, request: CkanRequest, name: str, value: str) -> List: search_value = "{}:{}".format(name, value) query = {"query": search_value} response = request.gets("resource_search", query=query) results = response.get("result").pop("results") resources = list() for result in results: resource_instance = cls(result) resources.append(resource_instance) return resources
def list(cls, request: CkanRequest): response = request.gets("package_list") results = response.pop("result") name_dict_list = [{"name": name} for name in results] packages = list() for result in name_dict_list: package_instance = cls(result) packages.append(package_instance) return packages
def list(cls, request: CkanRequest): response = request.gets("tag_list") results = response.pop("result") name_dict_list = [{"name": name} for name in results] tags = list() for result in name_dict_list: tag_instance = cls(result) tags.append(tag_instance) return tags
def list(cls, request: CkanRequest): response = request.gets("group_list") results = response.pop("result") name_dict_list = [{"name": name} for name in results] groups = list() for result in name_dict_list: group_instance = cls(result) groups.append(group_instance) return groups