DreadPirateShawn / goodreads

:snake: Python wrapper for Goodreads API :books:
0 stars 0 forks source link

book.gid sometimes returns ordereddict rather than id #3

Closed DreadPirateShawn closed 5 years ago

DreadPirateShawn commented 5 years ago

From some vectors, the book data presents the gid as text, whereas other vectors returns the book data as an OrderedDict.

>>> from goodreads import client
>>> gc = client.GoodreadsClient("...", "...")
>>> books = gc.shelf("18761398", 'to-read')
>>> books[0].gid
OrderedDict([('@type', 'integer'), ('#text', '25109947')])
>>> book = gc.book(25109947)
>>> book.gid
'25109947'