Skip to main content

A simple Python wrapper for the Amazon.com Product Advertising API

Project description

(‘Amazon Simple Product API n==========================nA simple Python wrapper for the Amazon.com Product Advertising API. n[![Build Status](https://secure.travis-ci.org/yoavaviram/python-amazon-simple-product-api.png?branch=master)](http://travis-ci.org/yoavaviram/python-amazon-simple-product-api)nnnFeaturesn——–nn* An object oriented interface to Amazon productsn* Supports both item search and item lookupn* Compatible with Google App EnginennnDependenciesn————–nBefore you get started, make sure you have:nn* Installed [Bottlenose](https://github.com/dlo/bottlenose) (pip install bottlenose)n* Installed lxml (pip install lxml)n* An Amazon Product Advertising accountn* An AWS accountnnnUsagen—–nnLookup:nn >>> from amazon.api import AmazonAPIn >>> amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG)n >>> product = amazon.lookup(ItemId=”B0051QVF7A”)n >>> product.titlen 'Kindle, Wi-Fi, 6” E Ink Display - for international shipment'n >>> product.price_and_currencyn (109.0, 'USD')n >>> product.eann '0814916014354'n >>> product.large_image_urln 'http://ecx.images-amazon.com/images/I/411H%2B731ZzL.jpg'n >>> product.get_attribute('Publisher')n 'Amazon Digital Services, Inc'n >>> product.get_attributes(['ItemDimensions.Width', 'ItemDimensions.Height'])n {'ItemDimensions.Width': '450', 'ItemDimensions.Height': '34'}nnThe API wrapper supports many other product attributes as well.nnSearch:nn >>> from amazon.api import AmazonAPIn >>> amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG)n >>> products = amazon.search(Keywords='kindle', SearchIndex='All')n >>> for i, product in enumerate(products):n >>> print “{0}. '{1}'”.format(i, product.title)n 0. 'Kindle, Wi-Fi, 6” E Ink Display - includes Special Offers & Sponsored Screensavers'n 1. 'Kindle Fire, Full Color 7” Multi-touch Display, Wi-Fi'n 2. 'Kindle US Power Adapter (Not included with Kindle or Kindle Touch)'n 3. 'Kindle Touch, Wi-Fi, 6” E Ink Display - includes Special Offers & Sponsored Screensavers'n 4. 'Kindle Keyboard 3G, Free 3G + Wi-Fi, 6” E Ink Display - includes Special Offers & Sponsored Screensavers'n 5. 'Kindle Touch 3G, Free 3G + Wi-Fi, 6” E Ink Display - includes Special Offers & Sponsored Screensavers'n …n 49. 'Kindle Wireless Reading Device (6” Display, U.S. Wireless)'nnThe search method returns an iterable that will iterate through all products,non all pages available. Additional pages are retrieved automatically as needed.nKeep in mind that Amazon limits the number of pages it makes available.nnFor more information about these calls, please consult the [Product AdvertisingnAPI Developer Guide](http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html).nnThere is also a convenience method to search and return a list of the first N results:nn >>> from amazon.api import AmazonAPIn >>> amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG)n >>> products = amazon.search_n(1, Keywords='kindle', SearchIndex='All')n >>> len(products)n 1n >>> products[0].titlen 'Kindle, Wi-Fi, 6” E Ink Display - includes Special Offers & Sponsored Screensavers'nnnTestsn——nTo run the test suite please follow these steps:nn* Make sure [Nose](http://readthedocs.org/docs/nose/en/latest/) is installed: (pip install nose)n* Create a local file named: test_settings.py with the following variables set to the relevant values: AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAGn* Run nosetestsnnLicensen——-nnCopyright © 2012 Yoav AviramnnSee LICENSE for details.nn’,)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file python-amazon-simple-product-api-1.0.8.tar.gz.

File metadata

File hashes

Hashes for python-amazon-simple-product-api-1.0.8.tar.gz
Algorithm Hash digest
SHA256 f412c2606be8b02dbffb50d165cacd257cbc0303d459bf0f462a3dcba5209e60
MD5 57e75b36b4f83bfba1c45d9bddfa0436
BLAKE2b-256 46992d1f73a879c7d1d82df22fb393a783ac1767c58d02f2a68d64bc1500f940

See more details on using hashes here.

File details

Details for the file python_amazon_simple_product_api-1.0.8-py2.7.egg.

File metadata

File hashes

Hashes for python_amazon_simple_product_api-1.0.8-py2.7.egg
Algorithm Hash digest
SHA256 0b489eb260411ac422ac9319cc3628750efafce4ce34cb0bc05783149f51475e
MD5 23364e50e40815271fecbc70de0c1546
BLAKE2b-256 4b53d7c625dabec1e66e4d71fa9d0cad82226d80c5bd50764212d04aa0a0fdff

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page