[Biopython] Entrez.parse error

Konrad Koehler konrad.koehler at mac.com
Thu Dec 15 19:37:43 UTC 2016


Hello everyone,

I have been using Entrez.parse for years without any errors.  However just in the last day or two, it stopped working.  I have been able to reproduce the error using the following example from the biopython Package Entrez <http://biopython.org/DIST/docs/api/Bio.Entrez-module.html> documentation:

from Bio import Entrez
print Bio.__version__ # to verify the that latest version of biopython is installed
>>> 1.68

Entrez.email = "Your.Name.Here at example.org <mailto:Your.Name.Here at example.org>”

handle = Entrez.efetch("pubmed", id="19304878,14630660", retmode="xml")
records = Entrez.parse(handle)

for record in records:
    print(record['MedlineCitation']['Article']['ArticleTitle’])

The above generates the following error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/username/anaconda/lib/python2.7/site-packages/Bio/Entrez/Parser.py", line 304, in parse
    raise ValueError("The XML file does not represent a list. Please use Entrez.read instead of Entrez.parse")
ValueError: The XML file does not represent a list. Please use Entrez.read instead of Entrez.parse

records = Entrez.read(handle), does work, but the output is xml that would take some work to parse.

Does anyone have any suggestions on how to get Entrez.parse working again? I am also curious why this stopped working.  Has the NCBI server changed?

Thanks, Konrad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20161215/43db0986/attachment.html>


More information about the Biopython mailing list