-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathREADME
100 lines (69 loc) · 3.14 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
====================================================
Python bindings for Amazon's 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.
The Amazon API itself provides programmatic access to Amazon's product
selection and discovery functionality. It has search and look up capabilities,
provides information on products and other features such as Customer Reviews,
Similar Products, Wish Lists and New and Used listings. More information
about the API can be found at
https://affiliate-program.amazon.com/gp/advertising/api/detail/main.html
Basic usage
===========
In order to use this API you'll obviously need an Amazon Associates Web Service
account for which you must with Amazon at http://aws.amazon.com. Each account
contains an *AWSAccessKeyId* and a *SecretKey*.
Here is an example how to use the API to search for books of a certain
publisher::
AWS_KEY = '...'
SECRET_KEY = '...'
api = API(AWS_KEY, SECRET_KEY, 'de')
node = api.item_search('Books', Publisher='Galileo Press')
The ``node`` object returned is a `lxml.objectified`_ element. All its
attributes can be accessed the pythonic way::
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)
Please refer to the more extensive `documentation`_ for more details.
.. _lxml.objectified: http://codespeak.net/lxml/objectify.html
.. _documentation: http://packages.python.org/python-amazon-product-api/
Status
======
This module is still undergoing development. All operations can be used with
the API's ``call(Operation=...)`` method. Additionally, there is a number of
convenience methods that include for instance additional error checking.
These are currently limited to:
- ``ItemLookup``
- ``ItemSearch``
- ``SimilarityLookup``
- ``BrowseNodeLookup``
More functionality is to follow as development progresses.
Installation
============
In order to install python-amazon-product-api you can use::
pip python-amazon-product-api
or download the source package from
http://pypi.python.org/pypi/python-amazon-product-api, untar it and run ::
python setup.py install
You'll also find binaries there to make your life easier if you happen to use
a Windows system. If not, please send me an e-mail and complain loudly!
Development
===========
The development version is available `bitbucket.org`_. Feel free to clone the
repository and add your own features. ::
hg clone http://bitbucket.org/basti/python-amazon-product-api/
Patches are always welcome! Please make sure that your change does not break
the tests!
.. _bitbucket.org: http://bitbucket.org/basti/python-amazon-product-api/
License
=======
This module is release under the BSD License. You can find the full text of
the license in the LICENSE file.
Changelog
=========
.. include:: CHANGES