Skip to content
This repository was archived by the owner on May 8, 2018. It is now read-only.

Commit 30c10f0

Browse files
committed
This is the same python-amazon-mws repo.
I have created this new one under the same name for easier reference. This is the latest version of this API. It includes better error handling and fixes the UnicodeDecodingError. I apologize to all contributors but i had to delete the other repo because of compromised data.
1 parent ec56d20 commit 30c10f0

5 files changed

Lines changed: 647 additions & 3 deletions

File tree

LICENSE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
2+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
3+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
4+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
5+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
6+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
7+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
10+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 85 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,86 @@
1-
python-amazon-mws
2-
=================
1+
# ** DISCLAIMER **
2+
This API is in constant development. Do not rely on it too much until its in stable release.
3+
All except for the last two APIs ( InboundShipment and OutboundShipment ) are complete.
4+
Help towards completing this last two APIs would be greatly appreciated.
5+
I will mark this as stable 1.0 once all tests have been completed.
36

4-
A simple python API for Amazon MWS
7+
8+
9+
# Python Amazon MWS
10+
11+
Python Amazon MWS is a python interface for the Amazon MWS API.
12+
I wrote it to help me upload my products to amazon. However, seeing its potential i decided
13+
to expand it in order for it to cover most ( if not all ) operations in the Amazon MWS.
14+
15+
This is still an ongoing project. If you would like to contribute, see below :).
16+
17+
18+
Its based on the [amazon-mws-python](http://code.google.com/p/amazon-mws-python).
19+
20+
# API usage
21+
22+
Make sure you check out the Amazon MWS documentation at https://developer.amazonservices.com/
23+
24+
Here's an exmaple of how to use python-amazon-mws to upload your products to amazon.
25+
26+
27+
```python
28+
from mws import mws
29+
30+
# You can get all these credentials when you sign up for Amazon MWS
31+
32+
MWS_ACCESS_KEY = 'your key'
33+
MWS_SECRET_KEY = 'your secret'
34+
MERCHANT_ID = 'your merchantid'
35+
36+
# Amazon supports different file formats for uploading products
37+
# here i use a simple tsv file.
38+
39+
file_name = "templates/amazon-upload.tsv"
40+
41+
with open(file_name, "r+") as f:
42+
data = f.read()
43+
f.close()
44+
amazon = mws.Feeds(MWS_ACCESS_KEY, MWS_SECRET_KEY, MERCHANT_ID)
45+
response = amazon.submit_feed(data, feed_type="_POST_FLAT_FILE_LISTINGS_DATA_",
46+
content_type="text/tab-separated-values;charset=iso-8859-1")
47+
48+
# In shell...
49+
50+
print response
51+
<Element '{http://mws.amazonaws.com/doc/2009-01-01/}SubmitFeedResponse' at 0x8edaa4c>
52+
53+
```
54+
For more information, check out the [Products API Documentation](https://developer.amazonservices.com/gp/mws/api.html/182-2079318-8524647?ie=UTF8&section=products&group=products&version=latest).
55+
56+
Here's another example in which i use python-amazon-mws to query amazon for a product using the product's UPC
57+
58+
```python
59+
from mws import mws
60+
61+
MWS_ACCESS_KEY = 'your key'
62+
MWS_SECRET_KEY = 'your secret'
63+
MERCHANT_ID = 'your merchantid'
64+
MARKETPLACE_ID = 'your marketplaceid'
65+
UPC = "886039397430"
66+
67+
amazon = mws.Products(MWS_ACCESS_KEY, MWS_SECRET_KEY, MERCHANT_ID)
68+
response = amazon.list_matching_products(UPC, MARKETPLACE_ID)
69+
70+
# In shell...
71+
72+
print response
73+
<Element '{http://mws.amazonservices.com/schema/Products/2011-10-01}ListMatchingProductsResponse' at 0xa1b188c>
74+
75+
```
76+
77+
# To-Do
78+
79+
* Update README
80+
* Create tests
81+
* Finish InboundShipments & OutboundShipments APIs
82+
* Build Docs
83+
84+
# Contribute
85+
86+
If you like the project, please, contact me at commonzenpython@gmail.com (gtalk and email) and help me improve it.

mws/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)