pubmed_parser/medline_parser.py
def parse_chemical_list(medline):
    """Parse chemical list from article

    Parameters
    ----------
    medline: Element
        The lxml node pointing to a medline document

    Returns
    -------
    chemical_list: str
        String of semi-colon spearated chemical list
    """
    chemical_list = []
    chemicals  = medline.find('ChemicalList')
    if chemicals is not None:
        for chemical in chemicals.findall('Chemical'):
            substance_name = chemical.find('NameOfSubstance')
            chemical_list.append(
                substance_name.attrib.get('UI', '') + ':' + (substance_name.text.strip() or '')
            )
    chemical_list = '; '.join(chemical_list)
    return chemical_list
Parse chemical list from article

    Parameters
    ----------
    medline: Element
        The lxml node pointing to a medline document

    Returns
    -------
    chemical_list: str
        String of semi-colon spearated chemical list
    
Parse chemical list from article
Parameters

Element
The lxml node pointing to a medline document

Returns

str
String of semi-colon spearated chemical list
Parse chemical list from article Parameters Element The lxml node pointing to a medline document Returns str String of semi - colon spearated chemical list
def parse_chemical_list(medline):
    chemical_list = []
    chemicals  = medline.find('ChemicalList')
    if chemicals is not None:
        for chemical in chemicals.findall('Chemical'):
            substance_name = chemical.find('NameOfSubstance')
            chemical_list.append(
                substance_name.attrib.get('UI', '') + ':' + (substance_name.text.strip() or '')
            )
    chemical_list = '; '.join(chemical_list)
    return chemical_list
def parse_chemical_list ( medline ) : chemical_list = [ ] chemicals = medline . find ( 'ChemicalList' ) if chemicals is not None : for chemical in chemicals . findall ( 'Chemical' ) : substance_name = chemical . find ( 'NameOfSubstance' ) chemical_list . append ( substance_name . attrib . get ( 'UI' , '' ) + ':' + ( substance_name . text . strip ( ) or '' ) ) chemical_list = '; ' . join ( chemical_list ) return chemical_list
Parse chemical list from article
Parameters
Parse chemical list from article Parameters
"""Parse chemical list from article

    Parameters
    ----------
    medline: Element
        The lxml node pointing to a medline document

    Returns
    -------
    chemical_list: str
        String of semi-colon spearated chemical list
    """
medline