├── __pycache__ ├── engine_lister.cpython-36.pyc └── engine_scraper.cpython-36.pyc ├── data ├── jewelry_crosschecked.csv ├── jewelry_final.csv └── jewelry_merchandise.csv ├── engine_core.py ├── engine_lister.py └── scrapers ├── __pycache__ └── jewelry_scraper.cpython-36.pyc └── jewelry_scraper.py /__pycache__/engine_lister.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicksarris/dropshipping/b2f135498d2a3c7cfcff0e45b187456fb51032f3/__pycache__/engine_lister.cpython-36.pyc -------------------------------------------------------------------------------- /__pycache__/engine_scraper.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicksarris/dropshipping/b2f135498d2a3c7cfcff0e45b187456fb51032f3/__pycache__/engine_scraper.cpython-36.pyc -------------------------------------------------------------------------------- /data/jewelry_crosschecked.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicksarris/dropshipping/b2f135498d2a3c7cfcff0e45b187456fb51032f3/data/jewelry_crosschecked.csv -------------------------------------------------------------------------------- /data/jewelry_merchandise.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicksarris/dropshipping/b2f135498d2a3c7cfcff0e45b187456fb51032f3/data/jewelry_merchandise.csv -------------------------------------------------------------------------------- /engine_core.py: -------------------------------------------------------------------------------- 1 | __author__ = 'Nick Sarris (ngs5st)' 2 | 3 | import engine_lister 4 | from scrapers import jewelry_scraper 5 | 6 | def main(): 7 | 8 | selling_category = "Jewelry" 9 | walmart_key = "" 10 | rescrape_data = False 11 | 12 | if rescrape_data != False: 13 | if selling_category == "Jewelry": 14 | jewelry_scraper.walmart_jewelry(walmart_key) 15 | jewelry_scraper.ebay_jewelry() 16 | jewelry_scraper.data_cleanup() 17 | 18 | engine_lister.list_ebay(selling_category) 19 | 20 | if __name__ == '__main__': 21 | main() -------------------------------------------------------------------------------- /engine_lister.py: -------------------------------------------------------------------------------- 1 | __author__ = 'Nick Sarris (ngs5st)' 2 | 3 | import re 4 | import time 5 | import pandas as pd 6 | from ebaysdk.trading import Connection as Trading 7 | from ebaysdk.exception import ConnectionError 8 | 9 | def decide_category(item_name): 10 | 11 | category_dict = { 12 | 13 | "Anklet": 101437, 14 | "Bracelet": {"Diamond": 10976, 15 | "Pearl": 164316, 16 | "Other": 164315}, 17 | "Earrings": {"Diamond": 10986, 18 | "Pearl": 10990, 19 | "Other": 164321}, 20 | "Necklace": {"Diamond": 164331, 21 | "Pearl": 164333, 22 | "Other": 164332}, 23 | "Pendant": {"Diamond": 164331, 24 | "Pearl": 164333, 25 | "Other": 164332}, 26 | "Brooch": {"Pearl": 11013, 27 | "Other": 164337}, 28 | "Ring": {"Diamond": 67726, 29 | "Pearl": 11021, 30 | "Other": 164343}, 31 | "Band": {"Diamond": 67726, 32 | "Pearl": 11021, 33 | "Other": 164343}, 34 | "Other": 505 35 | 36 | } 37 | 38 | category_list_1 = ["Diamond", "Pearl"] 39 | category_list_2 = ["Pearl"] 40 | 41 | for key in category_dict.keys(): 42 | if key in item_name: 43 | if key not in ["Anklet", "Brooch"]: 44 | for cat in category_list_1: 45 | if cat in item_name: 46 | return cat, category_dict[key][cat] 47 | else: 48 | return "Other Gemstone", category_dict[key]["Other"] 49 | else: 50 | if key == "Brooch": 51 | for cat in category_list_2: 52 | if cat in item_name: 53 | return cat, category_dict[key][cat] 54 | else: 55 | return "Other Gemstone", category_dict[key]["Other"] 56 | else: 57 | return "Other Gemstone", category_dict[key] 58 | else: 59 | continue 60 | 61 | return "Other Gemstone", category_dict["Other"] 62 | 63 | def list_ebay(selling_category): 64 | 65 | if selling_category == 'Jewelry': 66 | 67 | merchandise = pd.read_csv('data/jewelry_final.csv', encoding='ISO-8859-1') 68 | api = Trading(config_file='data/ebay_auth.yaml') 69 | 70 | counter = 0 71 | for i, row in merchandise.iterrows(): 72 | while True: 73 | 74 | try: 75 | print("Listing Item #{}: {}".format(i, row['name'])) 76 | 77 | item_name = row['name'] 78 | image_urls = row['images'].split(',') 79 | description = row['long_description'] 80 | sale_price = ((int(row['sale_price']) * 1.15) - 0.01) 81 | type, category = decide_category(row['name']) 82 | upc_value = row['upc'] 83 | 84 | replacement_list = ["T.G.W.","T.W.","T.G.W","T.W","Created", 85 | "Princess-Cut","Cross-Over","Three Stone", 86 | "Cultured","Freshwater","Cocktail", 87 | "Three-Stone","Two-Tone"] 88 | 89 | listing_title = re.sub(r' \d+\-\d+\/\d+ Carat', "", item_name) 90 | listing_title = re.sub(r' \d+\/\d+ Carat', "", listing_title) 91 | listing_title = re.sub(r' \d+\/\d+ CT', "", listing_title) 92 | listing_title = re.sub(r' \d+\/\d+', "", listing_title) 93 | listing_title = re.sub(r' \d+ Carat', "", listing_title) 94 | listing_title = re.sub(r' \d+kt', "", listing_title) 95 | listing_title = re.sub(r' \d+\-\d+\.\dmm', "", listing_title) 96 | listing_title = re.sub(r' \d+\.\d+\-\d+\.\dmm', "", listing_title) 97 | listing_title = re.sub(r' \d+\.\d+\-\dmm', "", listing_title) 98 | listing_title = re.sub(r' \d+\-\dmm', "", listing_title) 99 | listing_title = re.sub(r' \dmm+\-\d+\.\dmm', "", listing_title) 100 | listing_title = re.sub(r' \d+\.\dmm+\-\d+\.\dmm', "", listing_title) 101 | listing_title = re.sub(r' \d+\.\dmm+\-\dmm', "", listing_title) 102 | listing_title = re.sub(r' \dmm+\-\dmm', "", listing_title) 103 | 104 | for replacement in replacement_list: 105 | listing_title = listing_title.replace(" " + replacement, "") 106 | 107 | try: 108 | listing_title = listing_title.split(',')[0] 109 | except: 110 | pass 111 | 112 | if len(listing_title) < 80: 113 | 114 | image_list = [] 115 | for image_url in image_urls: 116 | image_url = image_url.replace('[','').replace(']','') \ 117 | .replace("'",'').split('?')[0].strip() 118 | list.append(image_list, image_url) 119 | 120 | myitem = { 121 | 122 | "Item":{ 123 | 124 | "Title": listing_title, 125 | "Description": ''+ item_name +'
' + description+ '
We will ship all orders within ' 160 | '' 161 | '3 business days of payment. We take great care packaging every item to ' 162 | 'ensure safe and quality shipping
We will ' 169 | 'ship UPS/USPS/FedEx depending on your location and our discretion. Please make sure ' 170 | 'to provide the correct shipping address when placing your order. Packages are NOT ' 171 | 'sent out on Saturday or Sunday and transit times may vary depending on the carrier. ' 172 | 'Shipping time by eBay are not guaranateed and are subject to change especially during ' 173 | 'peak periods.
We take ' 180 | 'our reputation seriously, we buy and sell online, so we understand the value of trust.' 181 | ' If you are unsatisfied with your order, please contact us and we ' 183 | 'will work with you to resolve it to your satisfaction. Please allow 1-3 days for a ' 184 | 'response to all inquiries.