oauth and etsy-python

453 views
Skip to first unread message

George Vlachos

unread,
Jun 25, 2013, 1:41:28 AM6/25/13
to etsy-...@googlegroups.com
I am supporting an existing application that has already signed up and access to etsy, so I have the values for keys and secrets.
Recently I have just started with etsy-python and I am trying the following code (which I got most by looking through

import oauth2 as oauth
from etsy import Etsy, EtsyEnvProduction
from etsy.oauth import EtsyOAuthClient
etsy_env = EtsyEnvProduction()
oauth_client = EtsyOAuthClient(oauth_consumer_key='consumer-key',oauth_consumer_secret='consumer-secret', etsy_env=etsy_env)
oauth_client.token = oauth.Token(key='key',secret='secret')
etsy_api = Etsy(key_file='key-file',etsy_oauth_client=oauth_client, etsy_env=etsy_env)
etsy_api.ping()

all worked without errors up to the last statement where I get:

  File "etsy-0.3-py2.6.egg/etsy/_core.py", line 106, in __call__
  File "etsy-0.3-py2.6.egg/etsy/_core.py", line 143, in invoke
  File "etsy-0.3-py2.6.egg/etsy/_core.py", line 326, in _get
  File "etsy-0.3-py2.6.egg/etsy/_v2.py", line 25, in _get_url
  File "etsy-0.3-py2.6.egg/etsy/oauth.py", line 43, in do_oauth_request
  File "oauth2/__init__.py", line 662, in request
    req.sign_request(self.method, self.consumer, self.token)
  File "oauth2/__init__.py", line 493, in sign_request
    self['oauth_body_hash'] = base64.b64encode(sha(self.body).digest())
TypeError: sha1() argument 1 must be string or read-only buffer, not None

any help on this will be appreciated.

also I would like to ask if there more example code on how to use etsy-python

--
George

Matt Graham

unread,
Jun 25, 2013, 5:15:08 PM6/25/13
to Etsy API V2
Hi George,
The etsy fork of this repo is quite out of date. I wonder if you might have better luck using one of the more actively maintained repos?



--
You received this message because you are subscribed to the Google Groups "Etsy API V2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to etsy-api-v2...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

George Vlachos

unread,
Jun 26, 2013, 4:03:45 AM6/26/13
to etsy-...@googlegroups.com
The etsy-tornado repo (https://github.com/alekstorm/etsy-tornado) seems also not to have been updated in the last 2 years. However I tried it and found that I was able to use it for a public method (findAllShopListingsActive). Sadly the oauth library there does not seem to have been updated, I am getting errors when I try to use it for a method like findAllShopReceiptsByStatus which requires authendication.

--
Reply all
Reply to author
Forward
0 new messages