Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Support for Etsy API v2 #1
Here are changes that I made to etsy-python in order to make it work with Etsy API v2.
I am using this for a Django-powered site that creates Etsy listings from a CSV file. I wrote this site for my sister so that she could save time. As a result, this has been tested but only with a fairly limited set of functionality, primary the createListing and uploadListingImage calls. I am using Python 2.7 -- not sure if anything 2.7-specific crept in there. I did a quick test with Python 2.5 and I was able to create a listing and upload an image to the listing in the Sandbox so that's a good sign.
I haven't tested extensively with different character encodings for titles and descriptions. Actually, my sister was having problems because she was using Windows and so her data had character code \x92 in it, which is a right single quote/apostrophe, U+2019 (8217), in the Windows-1252 character encoding. The Etsy API was choking on this. I tried reencoding the text to UTF-8, but it seems like the Etsy API only allows a limited set of characters in titles and descriptions. So maybe this isn't an issue if Etsy doesn't support Unicode, but you would know better than me.
These changes require the oauth2 package for OAuth support -- http://pypi.python.org/pypi/oauth2/ -- personally, I am using oauth2-1.2.0-py2.7.egg -- I've made oauth2 an optional dependency (i.e.: it's in the "extras_require" section of setup.py) though, since you should in theory be able to use etsy-python just fine without installing oauth2 if you're only doing read-only, unauthenticated operations. Personally, I'm doing pretty much all authenticated operations so I haven't tested much without oauth2.
Thanks for making etsy-python available. I hope that these changes are useful and help to revive etsy-python so that Python developers have a nice API for accessing Etsy.
It looks like the readme needs updating for other things too: