Exemplo n.º 1
0
    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
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
    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
Exemplo n.º 4
0
    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
Exemplo n.º 5
0
    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
Exemplo n.º 6
0
    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
Exemplo n.º 7
0
    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