Goodreads Developers discussion

13 views
questions > Python - inconsistency in nesting of arrays for authors

Comments Showing 1-1 of 1 (1 new)    post a comment »
dateUp arrow    newest »

message 1: by Michael (new)

Michael Stoop | 2 comments Hi all, I'm new to the goodreads API but have been hobbying hard for the last two days using Python and the goodreads_api_client wrapper.

I've come across a some challenges that appear to require me to workaround some issues.

The biggest hurdle seems to be how the API returns objects with multiple authors.
In my common sense I'd think that if something can be an array, it should always be an array, even though there's only a single element in it.

When comparing the books: "John Dies At The End" by David Wong (book id 1857440) with "My Life as a White Trash Zombie" by Diana Rowland (book id 9640626), I notice that for the latter, two authors are listed (second is Daniel Dos Santos as Cover Artist).
For most/all of my other books in the library, the Authors object contains a single OrderedDict of id, name etc, but when multiple authors occur, the nesting is different, leading me to hack all kinds of object-level checks.

I've worked around this now, but just wondering if this is an intentional behavior or if I'm missing something.
Same behavior for popular-shelves. If there's just one, the nesting is one level higher.


back to top