basti / python-amazon-product-api (http://pypi.python.org/pypi/python-amazon-product-api/)

A Python wrapper for the Amazon Product Advertising API. This module offers a light-weight access to the latest version of the Amazon Product Advertising API without getting in your way. All requests are signed as required since August 15, 2009.

python-amazon-product-api

This is a python wrapper around the Amazon Product Advertising API. It offers a light-weight access to the latest version of the Amazon Product Advertising API without getting in your way. All requests are signed as required since August 15, 2009.

Status

This module is still undergoing development. The support for the Amazon Product API is currently limited to a number of operations. Supported so far are:

  • ItemLookup
  • ItemSearch
  • SimilarityLookup
  • ListLookup
  • ListSearch
  • Help
  • BrowseNodeLookup

More functionality is to follow as development progresses. Have a look at the preliminary ReleasePlan.

Requirements

The only requirement is python-lxml >=2.1.5. However, people can use their own.

Example

from amazonproduct import API

AWS_KEY = '...'
SECRET_KEY = '...'

api = API(AWS_KEY, SECRET_KEY)
node = api.item_search('Books', Publisher='Galileo Press')

# 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

# 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)

All its content can be accessed using the lxml.objectify API.

Have a look at the examples directory and the documentation for more.

What now?

If you have any ideas or suggestions or want to help, drop me a line.

basti AT redtoad DOT de.


This revision is from 2010-03-17 10:44