src/pds_doi_service/core/outputs/osti/osti_web_parser.py
def parse_dois_from_label(label_text, content_type=CONTENT_TYPE_XML):
        """
        Parses one or more Doi objects from the provided OSTI-format label.

        Parameters
        ----------
        label_text : str
            Text body of the OSTI label to parse.
        content_type : str
            The format of the label's content. Both 'xml' and 'json' are
            currently supported.

        Returns
        -------
        dois : list of Doi
            Doi objects parsed from the provided label.
        errors: dict
            Dictionary mapping indices of DOI's in the provided label to lists
            of strings containing any errors encountered while parsing.

        """
        if content_type == CONTENT_TYPE_XML:
            dois, errors = DOIOstiXmlWebParser.parse_dois_from_label(label_text)
        elif content_type == CONTENT_TYPE_JSON:
            dois, errors = DOIOstiJsonWebParser.parse_dois_from_label(label_text)
        else:
            raise InputFormatException(
                "Unsupported content type provided. Value must be one of the "
                f"following: [{CONTENT_TYPE_JSON}, {CONTENT_TYPE_XML}]"
            )

        return dois, errors

        Parses one or more Doi objects from the provided OSTI-format label.

        Parameters
        ----------
        label_text : str
            Text body of the OSTI label to parse.
        content_type : str
            The format of the label's content. Both 'xml' and 'json' are
            currently supported.

        Returns
        -------
        dois : list of Doi
            Doi objects parsed from the provided label.
        errors: dict
            Dictionary mapping indices of DOI's in the provided label to lists
            of strings containing any errors encountered while parsing.

        
Parses one or more Doi objects from the provided OSTI-format label.
Parameters

label_text : str
Text body of the OSTI label to parse.
content_type : str
The format of the label's content. Both 'xml' and 'json' are
currently supported.

Returns

dois : list of Doi
Doi objects parsed from the provided label.
errors: dict
Dictionary mapping indices of DOI's in the provided label to lists
of strings containing any errors encountered while parsing.
Parses one or more Doi objects from the provided OSTI - format label . Parameters label_text : str Text body of the OSTI label to parse . content_type : str The format of the label ' s content . Both ' xml ' and ' json ' are currently supported . Returns dois : list of Doi Doi objects parsed from the provided label . errors : dict Dictionary mapping indices of DOI ' s in the provided label to lists of strings containing any errors encountered while parsing .
def parse_dois_from_label(label_text, content_type=CONTENT_TYPE_XML):
        if content_type == CONTENT_TYPE_XML:
            dois, errors = DOIOstiXmlWebParser.parse_dois_from_label(label_text)
        elif content_type == CONTENT_TYPE_JSON:
            dois, errors = DOIOstiJsonWebParser.parse_dois_from_label(label_text)
        else:
            raise InputFormatException(
                "Unsupported content type provided. Value must be one of the "
                f"following: [{CONTENT_TYPE_JSON}, {CONTENT_TYPE_XML}]"
            )
        return dois, errors
def parse_dois_from_label ( label_text , content_type = CONTENT_TYPE_XML ) : if content_type == CONTENT_TYPE_XML : dois , errors = DOIOstiXmlWebParser . parse_dois_from_label ( label_text ) elif content_type == CONTENT_TYPE_JSON : dois , errors = DOIOstiJsonWebParser . parse_dois_from_label ( label_text ) else : raise InputFormatException ( "Unsupported content type provided. Value must be one of the " f"following: [{CONTENT_TYPE_JSON}, {CONTENT_TYPE_XML}]" ) return dois , errors
Parses one or more Doi objects from the provided OSTI-format label.
Parses one or more Doi objects from the provided OSTI - format label .
"""
        Parses one or more Doi objects from the provided OSTI-format label.

        Parameters
        ----------
        label_text : str
            Text body of the OSTI label to parse.
        content_type : str
            The format of the label's content. Both 'xml' and 'json' are
            currently supported.

        Returns
        -------
        dois : list of Doi
            Doi objects parsed from the provided label.
        errors: dict
            Dictionary mapping indices of DOI's in the provided label to lists
            of strings containing any errors encountered while parsing.

        """
label_text
content_type