Small bugfix release!
Important
The following operations are deprecated since 15 July 2010 and are now answered with a ‘410 Gone’ (and a DeprecatedOperation exception):
Bugfix release! High time I get some continuous integration set up!
Locale parameter is now required at initialisation.
# before you could write
api = API(AWS_KEY, SECRET_KEY)
# now you have to specify your locale
api = API(AWS_KEY, SECRET_KEY, 'de')
Custom test server (tests.server.TestServer) added. It runs on localhost and mimicks the Amazon webservice by replaying local XML files.
Testing now supports multiple locales. Please not that you have to run python setup.py test to run the unittests.
ResultPaginator now also works with XPath expressions for attributes (Bug reported Giacomo Lacava).
Custom lookup for XML elements (during parsing) ensures that <ItemId/> and <ASIN> are now always objectify.StringElement (Bug reported by Brian Browning).
Fixed #11: Module can now be installed library without lxml being installed first.
Regular expressions for parsing error messages can now deal with the Japanese version.
Warning
The support for the Japanese locale (jp) is still very experimental! A few error messages have still to be translated and the functionality has to be confirmed. If you know Japanese, get in touch!
Tests run now for all API versions. Test cases can now be told which versions to use (class attribute api_versions set to i.e. ['2009-10-01']).
A custom AWS response processor can now be defined. For instance, here is one using xml.minidom instead of lxml:
def minidom_response_parser(fp):
root = parse(fp)
# parse errors
for error in root.getElementsByTagName('Error'):
code = error.getElementsByTagName('Code')[0].firstChild.nodeValue
msg = error.getElementsByTagName('Message')[0].firstChild.nodeValue
raise AWSError(code, msg)
return root
api = API(AWS_KEY, SECRET_KEY, processor=minidom_response_parser)
root = api.item_lookup('0718155157')
print root.toprettyxml()
# ...
Fixed #3: Support for API Version 2009-11-01.
Fixed #4: When using a bad parameter combination, an InvalidParameterCombination exception is raised.
Fixed #5: InvalidSearchIndex is raised when unknown SearchIndex is specified.
Fixed #7: Specifying API versions works now for more than just one test per test case.
The setup.py command has been empowered a bit with the following additional options: test, build_sphinx, upload_sphinx.
ResultPaginator attributes _get_current_page_numer, _get_total_results and _get_total_page_numer are now private.
This is the first public release. We’re now available via the Cheeseshop! http://pypi.python.org/pypi/python-amazon-product-api
Initial release.