Skip to content

Commit 4b53ae6

Browse files
authored
Documentation format and throttling update
1 parent 6276110 commit 4b53ae6

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,46 +31,43 @@ You can install or upgrade the module with:
3131

3232
Usage guide
3333
-----------
34-
Basic usage:
34+
**Basic usage:**
3535

3636
from amazon.paapi import AmazonAPI
3737
amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY)
3838
product = amazon.get_product('B01N5IB20Q')
3939
print(product.title)
4040

41-
Get multiple product information:
41+
**Get multiple product information:**
4242

4343
product = amazon.get_products('B01N5IB20Q,B01F9G43WU')
4444
print(product[0].images.large)
4545
print(product[1].prices.price.value)
4646

47-
Use URL insted of ASIN:
47+
**Use URL insted of ASIN:**
4848

4949
product = amazon.get_product('https://www.amazon.com/dp/B01N5IB20Q')
5050

51-
Get product variations:
51+
**Get product variations:**
5252

5353
product = amazon.get_variations('B01N5IB20Q')
5454
print(product[0].title)
5555

56-
Search product:
56+
**Search product:**
5757

5858
product = amazon.search_products(item_count=25, keywords='speaker')
5959
print(product[14].url)
6060

61-
Get the ASIN from a URL:
61+
**Get the ASIN from a URL:**
6262

6363
from amazon.tools import get_asin
6464
asin = get_asin('https://www.amazon.com/dp/B01N5IB20Q')
6565

66-
Throttling:
66+
**Throttling:**
6767

68-
Throttling value must be `0 < value <= 1`. This value throttles requests to a maxiumum of one request per `1 / value` seconds. Note that this value is a per-worker throttling, so applications with multiple workers may make more requests per second. Throttling value is [set by default to `0.8`](https://github.com/sergioteula/python-amazon-paapi/blob/master/amazon/paapi.py#L36) or one request per 1.25 seconds.
68+
Throttling value must be `0 < value <= 1`. This value throttles requests to a maximum of one request per `1 / value` seconds. Note that this value is a per-worker throttling, so applications with multiple workers may make more requests per second. Throttling value is [set by default to `0.8`](https://github.com/sergioteula/python-amazon-paapi/blob/master/amazon/paapi.py#L36) or one request per 1.25 seconds.
6969

70-
from amazon.paapi import AmazonAPI
71-
amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY, throttling=0.5) # Max one request per two seconds.
72-
product = amazon.get_product('B01N5IB20Q')
73-
print(product.title)
70+
amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY, throttling=0.5) # Max one request every two seconds
7471

7572
Changelog
7673
-------------

0 commit comments

Comments
 (0)