Python wrapper for the Etsy API based on Tornado's IOLoop
Based on mcfunley/etsy-python, by Dan McKinley - [email protected] - http://mcfunley.com
The simplest way to install the module is using setuptools.
$ easy_install etsy-tornado
To install from source, extract the tarball and use the following commands.
$ python setup.py build
$ python setup.py install
To use, first register for an Etsy developer key. Below is an example session.
from etsy import EtsyV2, Association, env
from tornado import gen
from tornado.ioloop import IOLoop
@gen.engine
def example():
api = yield gen.Task(EtsyV2, 'YOUR-API-KEY-HERE', env=env.ProductionEnv)
listings = yield gen.Task(
api.findAllListingActive,
keywords='candle',
limit=1,
fields=['title','price'],
includes=[Association('MainImage', fields=['url_75x75'])])
print listings[0]
io_loop.stop()
io_loop = IOLoop.instance()
io_loop.add_callback(example)
io_loop.start()
See also this blog post on Code as Craft.
This package comes with a reasonably complete unit test suite. In order to run the tests, use:
$ python setup.py test
Some of the tests (those that actually call the Etsy API) require your API key to be locally configured. See the Configuration section, above.
- Rewrote to use non-blocking calls to the Etsy API through Tornado's IOLoop.
- Removed type-checking in favor of native Python function signature validation.
- Removed method table cache.
- Removed API key file storage.
- Allowing Python Longs to be passed for parameters declared as "integers" by the API (thanks to Marc Abramowitz).
- Support for Etsy API v2 thanks to Marc Abramowitz.
- Removed support for now-dead Etsy API v1.
- Added a cache for the method table json.
- Added a logging facility.
- Added local configuration (~/.etsy) to eliminate cutting & pasting of api keys.
- Added client-side type checking for parameters.
- Added support for positional arguments.
- Added a test suite.
- Began differentiation between API versions.
- Added module to PyPI.
Initial release