def efetch(db, **keywords):
 cgi = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi'
 variables = {'db': db}
 variables.update(keywords)
 post = False
 try:
  ids = variables['id']
 except KeyError:
  pass
 else:
  if isinstance(ids, list):
   ids = ','.join(ids)
   variables['id'] = ids
  elif isinstance(ids, int):
   ids = str(ids)
   variables['id'] = ids
  if (ids.count(',') >= 200):
   post = True
 return _open(cgi, variables, post=post)

def efetch ( db , ** keywords ) : cgi = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi' variables = { 'db' : db } variables . update ( keywords ) post = False try : ids = variables [ 'id' ] except KeyError : pass else : if isinstance ( ids , list ) : ids = ',' . join ( ids ) variables [ 'id' ] = ids elif isinstance ( ids , int ) : ids = str ( ids ) variables [ 'id' ] = ids if ( ids . count ( ',' ) >= 200 ) : post = True return _open ( cgi , variables , post = post )
fetches entrez results which are returned as a handle .