Ejemplo n.º 1
0
    def getMetadata(self, objectId=None, **filters):
        """ Request metadata about a text or a collection

        :param textId: Object Identifier to filter on
        :type textId: str
        :param filters: Kwargs parameters.
        :type filters: dict
        :return: Collection
        """
        if objectId is not None:
            filters["urn"] = objectId

        ti = TextInventory()
        ti.parse(self.endpoint.getCapabilities(**filters))
        if objectId:
            return [x for x in [ti] + ti.descendants if x.id == objectId][0]
        return ti