pubmed_parser/medline_parser.py
def parse_mesh_terms(medline):
    """Parse MESH terms from article

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

    Returns
    -------
    mesh_terms: str
        String of semi-colon spearated MeSH (Medical Subject Headings)
        terms contained in the document.
    """
    if medline.find('MeshHeadingList') is not None:
        mesh = medline.find('MeshHeadingList')
        mesh_terms_list = [
            m.find('DescriptorName').attrib.get('UI', '') +
            ":" +
            m.find('DescriptorName').text for m in mesh.getchildren()
        ]
        mesh_terms = '; '.join(mesh_terms_list)
    else:
        mesh_terms = ''
    return mesh_terms
Parse MESH terms from article

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

    Returns
    -------
    mesh_terms: str
        String of semi-colon spearated MeSH (Medical Subject Headings)
        terms contained in the document.
    
Parse MESH terms from article
Parameters

Element
The lxml node pointing to a medline document

Returns

str
String of semi-colon spearated MeSH (Medical Subject Headings)
terms contained in the document.
Parse MESH terms from article Parameters Element The lxml node pointing to a medline document Returns str String of semi - colon spearated MeSH ( Medical Subject Headings ) terms contained in the document .
def parse_mesh_terms(medline):
    if medline.find('MeshHeadingList') is not None:
        mesh = medline.find('MeshHeadingList')
        mesh_terms_list = [
            m.find('DescriptorName').attrib.get('UI', '') +
            ":" +
            m.find('DescriptorName').text for m in mesh.getchildren()
        ]
        mesh_terms = '; '.join(mesh_terms_list)
    else:
        mesh_terms = ''
    return mesh_terms
def parse_mesh_terms ( medline ) : if medline . find ( 'MeshHeadingList' ) is not None : mesh = medline . find ( 'MeshHeadingList' ) mesh_terms_list = [ m . find ( 'DescriptorName' ) . attrib . get ( 'UI' , '' ) + ":" + m . find ( 'DescriptorName' ) . text for m in mesh . getchildren ( ) ] mesh_terms = '; ' . join ( mesh_terms_list ) else : mesh_terms = '' return mesh_terms
Parse MESH terms from article
Parameters
Parse MESH terms from article Parameters
"""Parse MESH terms from article

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

    Returns
    -------
    mesh_terms: str
        String of semi-colon spearated MeSH (Medical Subject Headings)
        terms contained in the document.
    """
medline