pubmed/functions.py
def search_articles(searchterm,email):
    '''search_articles
    Return list of articles based on search term
    Parameters
    ==========
    searchterm: str
       a search term to search for
    Returns
    =======
    articles: Article objects
        a list of articles that match search term
    '''
    print "Getting pubmed articles for search term %s" %(searchterm)

    Entrez.email = email
    handle = Entrez.esearch(db='pubmed',term=searchterm,retmax=5000)
    record = Entrez.read(handle)

    # If there are papers
    if "IdList" in record:
        if record["Count"] != "0":
            # Fetch the papers
            ids = record['IdList']
            handle = Entrez.efetch(db='pubmed', id=ids,retmode='xml',retmax=5000)
            return Entrez.read(handle)

    # If there are no papers
    else:
        print "No papers found for searchterm %s!" %(searchterm)
search_articles
    Return list of articles based on search term
    Parameters
    ==========
    searchterm: str
       a search term to search for
    Returns
    =======
    articles: Article objects
        a list of articles that match search term
    
search_articles
Return list of articles based on search term
Parameters

str
a search term to search for
Returns

Article objects
a list of articles that match search term
search_articles Return list of articles based on search term Parameters str a search term to search for Returns Article objects a list of articles that match search term
def search_articles(searchterm,email):
    print "Getting pubmed articles for search term %s" %(searchterm)
    Entrez.email = email
    handle = Entrez.esearch(db='pubmed',term=searchterm,retmax=5000)
    record = Entrez.read(handle)
    if "IdList" in record:
        if record["Count"] != "0":
            ids = record['IdList']
            handle = Entrez.efetch(db='pubmed', id=ids,retmode='xml',retmax=5000)
            return Entrez.read(handle)
    else:
        print "No papers found for searchterm %s!" %(searchterm)
def search_articles ( searchterm , email ) : print "Getting pubmed articles for search term %s" % ( searchterm ) Entrez . email = email handle = Entrez . esearch ( db = 'pubmed' , term = searchterm , retmax = 5000 ) record = Entrez . read ( handle ) if "IdList" in record : if record [ "Count" ] != "0" : ids = record [ 'IdList' ] handle = Entrez . efetch ( db = 'pubmed' , id = ids , retmode = 'xml' , retmax = 5000 ) return Entrez . read ( handle ) else : print "No papers found for searchterm %s!" % ( searchterm )
search_articles
Return list of articles based on search term
Parameters
search_articles Return list of articles based on search term Parameters
'''search_articles
    Return list of articles based on search term
    Parameters
    ==========
    searchterm: str
       a search term to search for
    Returns
    =======
    articles: Article objects
        a list of articles that match search term
    ''' # If there are papers # Fetch the papers # If there are no papers
searchterm
email