Amazon Product API

There is an example of this already online, but I don't like it.


from amazonproduct import API
from lxml import objectify

AWS_KEY = ''
SECRET_KEY = ''

api = API(AWS_KEY, SECRET_KEY, 'us')
node = api.item_search('Books', Keywords='0824832752')

# node object returned is a lxml.objectified element
# .pyval will convert the node content into int here
total_results = node.Items.TotalResults.pyval
total_pages = node.Items.TotalPages.pyval

print total_results


#get all books from result set and
#print author and title
for book in node.Items.Item:
    print '%s: "%s"' % (book.ItemAttributes.Author,
                        book.ItemAttributes.Title)
    print objectify.dump(book)