from etsy import Etsy import pandas as pd import matplotlib.pyplot as plt plt.rcParams['axes.labelsize'] = 14 plt.rcParams['xtick.labelsize'] = 12 plt.rcParams['ytick.labelsize'] = 12 api = Etsy(key_file='./.env') shops = [] for x in range(0,2): shops.append(api.findAllShops(shop_name='photography', limit=1)) shops shops_data = pd.DataFrame.from_records(shops) shops_data = shops_data.set_index('shop_name') shops_data.info() shops_data.head(3) // This is what we are trying to learn shops_data["num_favorers"] # In[ ] shops_data.plot(kind='scatter', x='listing_active_count', y='num_favorers', figsize=(5,3)) plt.show()
etsy_env=etsy_env) else: sys.stderr.write('ERROR: You must set oauth_consumer_key and ' 'oauth_consumer_secret in config.py\n') sys.exit(1) if (hasattr(config, 'oauth_token_key') and hasattr(config, 'oauth_token_secret')): oauth_client.token = oauth.Token(key=config.oauth_token_key, secret=config.oauth_token_secret) else: webbrowser.open(oauth_client.get_signin_url()) oauth_client.set_oauth_verifier(input('Enter OAuth verifier: ')) write_config_file(oauth_client.token) etsy_api = Etsy(etsy_oauth_client=oauth_client, etsy_env=etsy_env, log=my_log) # print 'oauth access token: (key=%r; secret=%r)' % # (oauth_client.token.key, oauth_client.token.secret) print('findAllShopListingsActive => %r' % etsy_api.findAllShopListingsActive( shop_id=config.user_id, sort_on='created', limit=1)) # print('getListing => %r' % etsy_api.getListing(listing_id=63067548)) print('findAllUserShippingTemplates => %r' % etsy_api.findAllUserShippingTemplates(user_id=config.user_id)) def testCreateListing(): print("Creating listing...")
from etsy import Etsy import json import pprint e = Etsy('w31e04vuvggcsv6iods79ol7', 'dgicdc7qts') # gotten from signing up at etsy.com/developers #magenta_listings = e.show_listings(color='#FF00FF') -- this works wedding = e.findBrowseSegmentListings(keywords='wedding') # pprint.pprint(magenta_listings) #method_table = e.getMethodTable() print wedding