app/iiif.py
def process_manifest(manifest_uri: str, get: bool=False) -> Optional[dict]:
    """
    Get label from a manifest, where the target of a
    bookmarking annotation is of type manifest.

    1) Retrieve a manifest based on the target id
    2) Parse returned JSON-LD
    3) Generate a simple OrderedDict to go in the Collection

    :param manifest_uri: manifest id
    :param get: boolean, if False, return empty label and don't dereference the manifest @id
    :return: Ordered Dict with manifest @id, label, and @type
    """
    label = "-"
    id = manifest_uri
    if manifest_uri:
        if get:
            _, m_json = json_get(manifest_uri)
            label = m_json.get("label")
            id = m_json.get("@id")
        m_dict = OrderedDict()
        m_dict['@id'] = id
        m_dict['@type'] = 'sc:Manifest'
        m_dict['label'] = label
        return m_dict
    else:
        return

    Get label from a manifest, where the target of a
    bookmarking annotation is of type manifest.

    1) Retrieve a manifest based on the target id
    2) Parse returned JSON-LD
    3) Generate a simple OrderedDict to go in the Collection

    :param manifest_uri: manifest id
    :param get: boolean, if False, return empty label and don't dereference the manifest @id
    :return: Ordered Dict with manifest @id, label, and @type
    
Get label from a manifest, where the target of a
bookmarking annotation is of type manifest.

1) Retrieve a manifest based on the target id
2) Parse returned JSON-LD
3) Generate a simple OrderedDict to go in the Collection
Get label from a manifest where the target of a bookmarking annotation is of type manifest . 1 ) Retrieve a manifest based on the target id 2 ) Parse returned JSON - LD 3 ) Generate a simple OrderedDict to go in the Collection
def process_manifest(manifest_uri: str, get: bool=False) -> Optional[dict]:
    label = "-"
    id = manifest_uri
    if manifest_uri:
        if get:
            _, m_json = json_get(manifest_uri)
            label = m_json.get("label")
            id = m_json.get("@id")
        m_dict = OrderedDict()
        m_dict['@id'] = id
        m_dict['@type'] = 'sc:Manifest'
        m_dict['label'] = label
        return m_dict
    else:
        return
def process_manifest ( manifest_uri : str , get : bool = False ) -> Optional [ dict ] : label = "-" id = manifest_uri if manifest_uri : if get : _ , m_json = json_get ( manifest_uri ) label = m_json . get ( "label" ) id = m_json . get ( "@id" ) m_dict = OrderedDict ( ) m_dict [ '@id' ] = id m_dict [ '@type' ] = 'sc:Manifest' m_dict [ 'label' ] = label return m_dict else : return
Get label from a manifest, where the target of a
bookmarking annotation is of type manifest.
Get label from a manifest where the target of a bookmarking annotation is of type manifest .
"""
    Get label from a manifest, where the target of a
    bookmarking annotation is of type manifest.

    1) Retrieve a manifest based on the target id
    2) Parse returned JSON-LD
    3) Generate a simple OrderedDict to go in the Collection

    :param manifest_uri: manifest id
    :param get: boolean, if False, return empty label and don't dereference the manifest @id
    :return: Ordered Dict with manifest @id, label, and @type
    """
Ordered Dict with manifest @id, label, and @type
Ordered Dict with manifest @id label and @type
manifest_uri
str
None
get
bool
boolean, if False, return empty label and don't dereference the manifest @id
boolean if False return empty label and don ' t dereference the manifest @id