[Biopython] can I use the xml parser in biopython on other xml files? how?

Wheaton Little wheatontrue at gmail.com
Thu Jul 12 08:53:26 UTC 2012


I would like to use the Biopython xml parser, if possible, on google
patent xmls:

http://www.google.com/googlebooks/uspto-patents-applications-text.html

unfortunately, this is what I get:

>>> t=open('ipa111229.xml','r').read()
>>> import Bio
>>> ttt=Bio.Entrez.read(t[:30000])

Traceback (most recent call last):
  File "<pyshell#20>", line 1, in <module>
    ttt=Bio.Entrez.read(t[:30000])
  File "/Library/Python/2.7/site-packages/Bio/Entrez/__init__.py",
line 351, in read
    record = handler.read(handle)
  File "/Library/Python/2.7/site-packages/Bio/Entrez/Parser.py", line
169, in read
    self.parser.ParseFile(handle)
TypeError: argument must have 'read' attribute

What would I have to do to use the parser on this xml?



More information about the Biopython mailing list