import metapub as mpub def literature_search(query): fetch = mpub.PubMedFetcher() ids = fetch.pmids_for_query(query) return(len(ids))