Example #1
0
 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']
Example #2
0
 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'])
Example #3
0
 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'])
Example #4
0
 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'])
Example #5
0
 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'])
Example #6
0
 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
Example #7
0
 def request(self, *args, **kwargs):
     """Create a GoodreadsRequest object and make that request"""
     req = GoodreadsRequest(self, *args, **kwargs)
     return req.request()
 def request(self, *args, **kwargs):
     """Create a GoodreadsRequest object and make that request"""
     req = GoodreadsRequest(self, *args, **kwargs)
     return req.request()
Example #9
0
 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
Example #10
0
 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']