PyAmazon 0.64: Support for specifying locale and associate ID on a per search basis
PyAmazon 0.64, a new release of PyAmazon that incorporates a couple of patches that have been submitted by some helpful users.
Christian Theune provided a patch that allows the locale and Associates ID to be specified on a per search basis. This is useful if you need to talk to multiple catalogs in a multi-threaded environment and possibly under other circumstances too. Christian also submitted a fix to the Sales Rank code so that it works in locales where '.' is used as a thousands separator.
The locale can be passed to one of the search functions using an optional parameter. e.g.
results = amazon.searchByArtist('Jesse Malin', locale = 'uk')
and similarly for the Associates ID:
results = amazon.searchByAuthor('A. M. Homes', associate = 'josephsondoto-20')
Patrick Phalen sent in a change so that whitespace (e.g. trailing newlines) is stripped when reading the Amazon key from a file.
Finally, Akihiro Takizawa emailed to let me know that the Japanese sever's location has changed to xml.amazon.co.jp so I've updated the locale definitions to reflect this.