def get_author_id(self, name): """ Get the id of an author given the name.""" name = urllib.quote_plus(name) goodreads_request = GoodreadsRequest("api/author_url/" + name, {}, self) response = goodreads_request.request() return response['author']['@id']
def author_by_id(self, **query_dict): """ Get information about an author from their id. Input example: { 'id' : '2546' } """ goodreads_request = GoodreadsRequest("author/show.xml", query_dict, self) response = goodreads_request.request() return Author(response['author'])
def book_title(self, **query_dict): """ Get information about a book. Input Example: {'author' : 'Chuck Palahniuk', 'title' : 'Fight Club'} """ goodreads_request = GoodreadsRequest("book/title.xml", query_dict, self) response = goodreads_request.request() return Book(response['book'])
def get_book_id(self, isbn): """ Get book id given the isbn. """ goodreads_request = GoodreadsRequest("book/isbn_to_id/" + isbn, {}, self) response = goodreads_request.request(return_raw=True) return response
def request(self, *args, **kwargs): """Create a GoodreadsRequest object and make that request""" req = GoodreadsRequest(self, *args, **kwargs) return req.request()
def get_book_id(self, isbn): """ Get book id given the isbn. """ goodreads_request = GoodreadsRequest("book/isbn_to_id/"+isbn, {}, self) response = goodreads_request.request(return_raw=True) return response
def get_author_id(self, name): """ Get the id of an author given the name.""" name = urllib.quote_plus(name) goodreads_request = GoodreadsRequest("api/author_url/"+name, {}, self) response = goodreads_request.request() return response['author']['@id']