Open GoogleCodeExporter opened 9 years ago
As best as I can tell, Google is not following their specification here. The
API docs
list when they might return multiple of an element, and they do not indicate
this for
dc:format. Further, it says it should only (at this time) indicate the number of
pages. So, this is yet another instance of the Google Book Search API
implementation
and docs disagreeing.
Original comment by sams.ja...@gmail.com
on 9 Dec 2009 at 12:33
You could try parsing the XML with VolumeEntry in gdata.books.data which was
recently added
http://code.google.com/p/gdata-python-client/source/browse/trunk/src/gdata/books
/
data.py
The VolumeEntry.format member is specified to allow multiple
gdata.dublincore.data.Format objects.
Original comment by jscud.w...@gmail.com
on 9 Dec 2009 at 12:51
Excuse my newbness, but how do you use the VolumeEntry class? I can't find a
method
that would do the parsing.
Original comment by smarth...@gmail.com
on 24 Feb 2010 at 11:14
To parse an XML string into a VolumeEntry class (or any other subclass of
atom.core.XmlElement) you can do:
volume_entry = atom.core.parse(xml_string, gdata.books.data.VolumeEntry)
Original comment by jscud.w...@gmail.com
on 24 Feb 2010 at 6:29
Okay, so using VolumeEntry doesn't fix this problem. When I try to use it I
don't get
any format objects. Should I file a separate bug for this?
>>> data =
urlopen("http://www.google.com/books/feeds/volumes/W-c9AAAAYAAJ").read()
>>> book = atom.core.parse(data, VolumeEntry)
>>> book.title
<atom.data.Title object at 0x288d990>
>>> book.title.text
'The tragedie of Macbeth'
>>> book.format
[]
>>>
Original comment by smarth...@gmail.com
on 25 Feb 2010 at 9:07
Original comment by afs...@google.com
on 7 Oct 2011 at 11:37
Original issue reported on code.google.com by
google....@shaftek.org
on 30 Oct 2009 at 1:25