Browse files

Update documentation and attribution information

  • Loading branch information...
alekstorm committed Nov 8, 2011
1 parent 4247b07 commit bd2157017665906a47e18d3f79cb405d6f236466
Showing with 43 additions and 83 deletions.
  1. +39 −79
  2. +4 −4 etsy/
@@ -1,116 +1,76 @@
-# etsy-python
-Python access to the Etsy API
+# etsy-tornado
+Python wrapper for the Etsy API based on Tornado's IOLoop
-By Dan McKinley - - [](
+Based on mcfunley/etsy-python, by Dan McKinley - - [](
## Installation
The simplest way to install the module is using
-$ easy_install etsy
+$ easy_install etsy-tornado
To install from source, extract the tarball and use the following commands.
$ python build
-$ sudo python install
+$ python install
## Simple Example
To use, first [register for an Etsy developer key](
Below is an example session.
-$ python
-Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12)
-[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
-Type "help", "copyright", "credits" or "license" for more information.
->>> from etsy import Etsy
->>> api = Etsy('YOUR-API-KEY-HERE')
->>> api.getFrontFeaturedListings(offset=10, limit=1)[0]['title']
-'Artists Eco Journal - Landscape Watercolor - Rustic Vegan Hemp and Recycled Rubber'
+from etsy import EtsyV2, Association, env
+from tornado import gen
+from tornado.ioloop import IOLoop
+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()
See also [this blog post](
on Code as Craft.
-## Configuration
-For convenience (and to avoid storing API keys in revision control
-systems), the package supports local configuration. You can manage
-your API keys in a file called $HOME/etsy/keys (or the equivalent on
-Windows) with the following format:
-v2 = 'Etsy API version 2 key goes here'
-Alternatively, you can specify a different key file when creating an API object.
-from etsy import Etsy
-api = Etsy(key_file='/usr/share/etsy/keys')
-(Implementation note: the keys file can be any valid python script that defines
-a module-level variable for the API version you are trying to use.)
## Tests
This package comes with a reasonably complete unit test suite. In order to run
the tests, use:
$ python 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.
-## Method Table Caching
-This module is implemented by metaprogramming against the method table published
-by the Etsy API. In other words, API methods are not explicitly declared by the
-code in this module. Instead, the list of allowable methods is downloaded and
-the patched into the API objects at runtime.
-This has advantages and disadvantages. It allows the module to automatically
-receive new features, but on the other hand, this process is not as fast as
-explicitly declared methods.
-In order to speed things up, the method table json is cached locally by default.
-If a $HOME/etsy directory exists, the cache file is created there. Otherwise, it
-is placed in the machine's temp directory. By default, this cache lasts 24 hours.
-The cache file can be specified when creating an API object:
-from etsy import Etsy
-api = Etsy(method_cache='myfile.json')
-Method table caching can also be disabled by passing None as the cache parameter:
-from etsy import Etsy
-# do not cache methods
-api = Etsy(method_cache=None)
## Version History
+### Version 0.4
+* 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.
### Version 0.3.1
* Allowing Python Longs to be passed for parameters declared as "integers" by the API
@@ -136,4 +96,4 @@ api = Etsy(method_cache=None)
* Added module to PyPI.
### Version 0.1 - 05-24-2010
-Initial release
+Initial release
@@ -15,11 +15,11 @@
from env import SandboxEnv
from throttled_httpclient import ThrottledAsyncHTTPClient
-__version__ = '0.3.1'
-__author__ = 'Dan McKinley'
-__copyright__ = 'Copyright 2010, Etsy Inc.'
+__version__ = '0.4'
+__author__ = 'Alek Storm, Dan McKinley'
+__copyright__ = 'Copyright 2011, Alek Storm. Copyright 2010, Etsy Inc.'
__license__ = 'GPL v3'
-__email__ = ''
+__email__ = ''
logger = logging.getLogger('etsy')

0 comments on commit bd21570

Please sign in to comment.