<jupyter_start><jupyter_text>MeSH<jupyter_code>mesh_term = '("COVID-19"[Mesh]) AND "Machine Learning"[Mesh]'<jupyter_output><empty_output><jupyter_text>Count<jupyter_code>import entrezpy.esearch.esearcher

esearch = entrezpy.esearch.esearcher.Esearcher( '<NAME>', '<EMAIL>' )
a = esearch.inquire({ 'db' : 'pubmed','term': mesh_term, 'rettype': 'uilist', 'sort': 'most+recent'})
uids = list(set(a.get_result().uids))
uids = uids[0:1]
len( uids )<jupyter_output><empty_output><jupyter_text>Text<jupyter_code>import entrezpy.esearch.esearcher

esearch = entrezpy.esearch.esearcher.Esearcher( '<NAME>', '<EMAIL>' )
a = esearch.inquire({ 'db' : 'pubmed','term': mesh_term, 'rettype': 'uilist', 'sort': 'most+recent'})
uids = list(set(a.get_result().uids))
uids = uids[0:1]
print( uids )<jupyter_output>['33492267']<jupyter_text>Grab JSON<jupyter_code>import entrezpy.esummary.esummarizer
import json

esummary = entrezpy.esummary.esummarizer.Esummarizer( '<NAME>', '<EMAIL>' )
a = esummary.inquire({ 'db' : 'pubmed', 'id' : uids })
summaries = a.get_result().summaries
print(json.dumps(summaries, indent=4, sort_keys=True))
import entrezpy.efetch.efetcher

e = entrezpy.efetch.efetcher.Efetcher( '<NAME>', '<EMAIL>')
analyzer = e.inquire({'db' : 'pubmed',
                      'id' : uids,
                      #'retmode' : 'xml',
                      'rettype' : 'abstract'})
analyzer.analyze_result()
entrezpy.base.analyzer.EutilsAnalzyer.analyze_result()
from bs4 import BeautifulSoup
y=BeautifulSoup(analyzer)
analyzer.PubmedArticle<jupyter_output><empty_output><jupyter_text>Semantic API Citation Count<jupyter_code>#!pip install semanticscholar
import semanticscholar as sch
import semanticscholar as sch
paper = sch.paper('10.1007/s00198-016-3828-8', timeout=2)
#paper.keys()
#paper['citations']
#paper['influentialCitationCount']
paper['numCitedBy']
#for author in paper['authors']:
#     print(author['name'])
#     print(author['authorId'])<jupyter_output><empty_output><jupyter_text>Create a parser<jupyter_code>import entrezpy.esummary.esummarizer
import entrezpy.efetch.efetcher
import entrezpy.elink.elinker
import entrezpy.elink.elink_analyzer

def parse_uids(uids):
    esummary = entrezpy.esummary.esummarizer.Esummarizer( '<NAME>', '<EMAIL>' )
    efetch = entrezpy.efetch.efetcher.Efetcher( '<NAME>', '<EMAIL>')
    elinkanalysis = entrezpy.elink.elink_analyzer.ElinkAnalyzer()
    elink = entrezpy.elink.elinker.Elinker('<NAME>', '<EMAIL>')


    result_summary = esummary.inquire({ 'db' : 'pubmed', 'id' : uids, 'retmax': 10 }).get_result().summaries
    result_fetch = efetch.inquire({'db' : 'pubmed', 'id' : uids, 'retmode' : 'xml', 'rettype' : 'abstract'}).get_result()
    result_elinks = elink.inquire({'dbfrom' : 'pubmed', 'id' : uids , 'cmd' : 'llinks'}, analyzer=a).get_result().dump()


parse_uids(uids = [25466529])<jupyter_output><?xml version="1.0" ?>
<!DOCTYPE PubmedArticleSet PUBLIC "-//NLM//DTD PubMedArticle, 1st January 2019//EN" "https://dtd.nlm.nih.gov/ncbi/pubmed/out/pubmed_190101.dtd">
<PubmedArticleSet>
<PubmedArticle>
    <MedlineCitation Status="MEDLINE" Owner="NLM">
        <PMID Version="1">25466529</PMID>
        <DateCompleted>
            <Year>2015</Year>
            <Month>12</Month>
            <Day>21</Day>
        </DateCompleted>
        <DateRevised>
            <Year>2018</Year>
            <Month>11</Month>
            <Day>13</Day>
        </DateRevised>
        <Article PubModel="Print-Electronic">
            <Journal>
                <ISSN IssnType="Electronic">1433-2965</ISSN>
                <JournalIssue CitedMedium="Internet">
                    <Volume>26</Volume>
                    <Issue>3</Issue>
                    <PubDate>
                        <Year>2015</Year>
                        <Month>Mar</Month>
                    </PubDate>
                </JournalIssue>
[...]<jupyter_text>Gitlab example<jupyter_code>sys.path.insert(1, os.path.join(sys.path[0], '../src'))
import entrezpy.efetch.efetcher


# Python argument parser (see [2] for more details)
demo_src = 'https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch'
ap = argparse.ArgumentParser(description="Entrezpy Efetcher() examples ({})".format(demo_src))
ap.add_argument('--email',
                type=str,
                required=True,
                help='email required by NCBI')
ap.add_argument('--apikey',
                type=str,
                default=None,
                help='NCBI apikey (optional)')

args = ap.parse_args()

# Prepare list of examples. Each example is a parameter dictionary as expected
# by Efetcher.
examples = [
            {'db' : 'pubmed','id' : [17284678,9997], 'retmode':'text', 'rettype': 'abstract'}
            ]

# Loop over examples
start = time.time()
for i in range(len(examples)):
    # Loop over retmodes
    for j in ['xml', 'text']:
        qrystart = time.time()
        # Init Efetcher
        ef = entrezpy.efetch.efetcher.Efetcher('efetcher', args.email, args.apikey)
        # Set retmode
        examples[i].update({'retmode':j})
        # Fetch example and return default efetch analyzer
        a = ef.inquire(examples[i])
        print("+Query {}\n+++\tParameters: {}\n+++\tStatus:".format(i, examples[i]), end='')
        # Test is query has been successful, e.g. no connection or NCBI errors.
        # In such a case, None would have been returned
        if not a:
        print("\tFailed: Response errors")
        return 0
        print("\tResponse OK")
        print("+++\tQuery time: {} sec".format(time.time()-qrystart))
    print("+Total time: {} sec".format(time.time()-start))
    return 0<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16074270557029177, 'fraction_numerical': 0.021573828470380193, 'mean_word_length': 3.4465408805031448, 'pattern_counts': {'":': 0, '<': 80, '<?xml version=': 1, '>': 80, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '509155', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 2121, 'n_tokens_neox': 1972, 'n_words': 346, 'path': 'notebooks/entrezpy/search_covid.ipynb', 'repo_name': 'ckrusemd/meta-analysis-tool', 'size': '5746'}