Skip to content

Commit 07b72fe

Browse files
committed
Updated version, changelog and readme format
1 parent e954002 commit 07b72fe

File tree

3 files changed

+51
-25
lines changed

3 files changed

+51
-25
lines changed

README.md

Lines changed: 49 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,69 +39,95 @@ Usage guide
3939
-----------
4040
**Basic usage:**
4141

42-
from amazon.paapi import AmazonAPI
43-
amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY)
44-
product = amazon.get_product('B01N5IB20Q')
45-
print(product.title)
42+
````python
43+
from amazon.paapi import AmazonAPI
44+
amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY)
45+
product = amazon.get_product('B01N5IB20Q')
46+
print(product.title)
47+
````
4648

4749
**Get multiple product information:**
4850

49-
product = amazon.get_products('B01N5IB20Q,B01F9G43WU')
50-
print(product[0].images.large)
51-
print(product[1].prices.price.value)
51+
````python
52+
product = amazon.get_products('B01N5IB20Q,B01F9G43WU')
53+
print(product[0].images.large)
54+
print(product[1].prices.price.value)
55+
````
5256

5357
**Use URL insted of ASIN:**
5458

55-
product = amazon.get_product('https://www.amazon.com/dp/B01N5IB20Q')
59+
````python
60+
product = amazon.get_product('https://www.amazon.com/dp/B01N5IB20Q')
61+
````
5662

5763
**Get product variations:**
5864

59-
product = amazon.get_variations('B01N5IB20Q')
60-
print(product[0].title)
65+
````python
66+
product = amazon.get_variations('B01N5IB20Q')
67+
print(product[0].title)
68+
````
6169

6270
**Search product:**
6371

64-
product = amazon.search_products(item_count=25, keywords='speaker')
65-
print(product[14].url)
72+
````python
73+
product = amazon.search_products(item_count=25, keywords='speaker')
74+
print(product[14].url)
75+
````
6676

6777
**Get browse node information:**
6878

69-
node = amazon.get_browsenodes(browse_nodes=browsenodes_list)
79+
````python
80+
node = amazon.get_browsenodes(browse_nodes=browsenodes_list)
81+
````
7082

7183
**Get the ASIN from a URL:**
7284

73-
from amazon.tools import get_asin
74-
asin = get_asin('https://www.amazon.com/dp/B01N5IB20Q')
85+
````python
86+
from amazon.tools import get_asin
87+
asin = get_asin('https://www.amazon.com/dp/B01N5IB20Q')
88+
````
7589

7690
**Throttling:**
7791

7892
Throttling value must be `greater than 0` or `False` to disable it. This value throttles requests to a maximum of one request every `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](https://github.com/sergioteula/python-amazon-paapi/blob/master/amazon/paapi.py#L36) to `0.8` or one request every 1.25 seconds.
7993

80-
amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY, throttling=0.5) # Max one request every two seconds
81-
amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY, throttling=False) # Unlimited requests per second
94+
````python
95+
amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY, throttling=0.5) # Max one request every two seconds
96+
amazon = AmazonAPI(KEY, SECRET, TAG, COUNTRY, throttling=False) # Unlimited requests per second
97+
````
8298

8399
**Serializer for Django:**
84100

85101
We provide a serializer for Django REST framework, which speeds up your API
86102
implementation.
87103

88-
from amazon.serializers import AmazonProductSerializer
89-
from rest_framework import serializers
104+
````python
105+
from amazon.serializers import AmazonProductSerializer
106+
from rest_framework import serializers
90107

91-
serialized_product = AmazonProductSerializer(product)
92-
serialized_product.data
108+
serialized_product = AmazonProductSerializer(product)
109+
serialized_product.data
110+
````
93111

94112
If you want to serialize a list of products:
95113

96-
serialized_products = AmazonProductSerializer(products, many=True)
97-
serialized_products.data
114+
````python
115+
serialized_products = AmazonProductSerializer(products, many=True)
116+
serialized_products.data
117+
````
98118

99119
For more information on how to work with serializers, check the documentation for
100120
[Django REST framework](https://www.django-rest-framework.org/api-guide/serializers/).
101121

102122

103123
Changelog
104124
-------------
125+
Version 3.3.2
126+
- Allow sending several products ids on get_product.
127+
- Updated get_asin for new URL format.
128+
- Added NL region support.
129+
- Removed type hints.
130+
105131
Version 3.3.1
106132
- Allow searching by browse_node or search_index alone.
107133
- Added license files for Amazon SDK.

amazon/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Amazon Product Advertising API wrapper for Python"""
22

3-
__version__ = '3.3.1'
3+
__version__ = '3.3.2'
44
__author__ = 'Sergio Abad'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name='python-amazon-paapi',
8-
version='3.3.1',
8+
version='3.3.2',
99
author='Sergio Abad',
1010
author_email='sergio.abad@bytelix.com',
1111
description='Amazon Product Advertising API 5.0 wrapper for Python',

0 commit comments

Comments
 (0)