pubmed_parser/medline_parser.py
def parse_medline_grant_id(path):
    """Parse grant id from Medline XML file

    Parameters
    ----------
    path: str
        The path to the XML with the information

    Returns
    -------
    grant_id_list: list
        List of dictionaries for all files in `path`. Each dictionary
        will have the information returned by `parse_grant_id`
    """
    tree = read_xml(path)
    medline_citations = tree.findall('//MedlineCitationSet/MedlineCitation')
    if len(medline_citations) == 0:
        medline_citations = tree.findall('//MedlineCitation')
    grant_id_list = list(map(parse_grant_id, medline_citations))
    grant_id_list = list(chain(*grant_id_list)) # flatten list
    return grant_id_list
Parse grant id from Medline XML file

    Parameters
    ----------
    path: str
        The path to the XML with the information

    Returns
    -------
    grant_id_list: list
        List of dictionaries for all files in `path`. Each dictionary
        will have the information returned by `parse_grant_id`
    
Parse grant id from Medline XML file
Parameters

str
The path to the XML with the information

Returns

list
List of dictionaries for all files in `path`. Each dictionary
will have the information returned by `parse_grant_id`
Parse grant id from Medline XML file Parameters str The path to the XML with the information Returns list List of dictionaries for all files in ` path ` . Each dictionary will have the information returned by ` parse_grant_id `
def parse_medline_grant_id(path):
    tree = read_xml(path)
    medline_citations = tree.findall('//MedlineCitationSet/MedlineCitation')
    if len(medline_citations) == 0:
        medline_citations = tree.findall('//MedlineCitation')
    grant_id_list = list(map(parse_grant_id, medline_citations))
    grant_id_list = list(chain(*grant_id_list)) 
    return grant_id_list
def parse_medline_grant_id ( path ) : tree = read_xml ( path ) medline_citations = tree . findall ( '//MedlineCitationSet/MedlineCitation' ) if len ( medline_citations ) == 0 : medline_citations = tree . findall ( '//MedlineCitation' ) grant_id_list = list ( map ( parse_grant_id , medline_citations ) ) grant_id_list = list ( chain ( * grant_id_list ) ) return grant_id_list
Parse grant id from Medline XML file
Parameters
Parse grant id from Medline XML file Parameters
"""Parse grant id from Medline XML file

    Parameters
    ----------
    path: str
        The path to the XML with the information

    Returns
    -------
    grant_id_list: list
        List of dictionaries for all files in `path`. Each dictionary
        will have the information returned by `parse_grant_id`
    """ # flatten list
path