initBasti / Amazon2PlentySync (public) (License: GPLv3) (since 2019-01-27) (hash sha1)
Transfer your data from you Amazon Flatfile spreadsheet over to the Plentymarkets system. How to is included in the readme
List of commits:
Subject Hash Author Date (UTC)
Changed the price upload to identify items that are not in plentymarkets and added a webshop price 4ab9bcd988f9eb26647748a8f80f25c8c5b7f2e2 Sebastian Fricke 2019-05-03 09:18:35
added Webshop to marketconnections 84f93694fe0c67972ad951649d9f6f0d577d3e29 Sebastian Fricke 2019-05-01 14:12:00
Added the modelnumber feature and removed the creation of empty features ea98391f2dbdf8fb8e601153b4f6ebfca504929c Sebastian Fricke 2019-05-01 12:31:19
Changed the feature upload into a loop for more overview 0a1bee82659a576c6fb4f2641aa3990d8d686b3c Sebastian Fricke 2019-05-01 10:04:20
Added a few new instructions to the Instructions file b4878c59958f89a02937de1dfc7aabbd23e71061 LagerBadel PC:Magdalena 2019-04-18 09:41:10
Made some fields not required but added Warnings for the log file, additionally some new amazon features were added. 6392338b7e9968be3bc4da9031144c3cc2cfae48 Sebastian Fricke 2019-04-18 09:37:51
Added an error log system and improved overall workflow 2e3763e436899466db9f03f70ea926869afd3219 Sebastian Fricke 2019-04-18 08:12:27
Added additional feature uploads 528cad4899d3e3adca5098c1a0ce92c2a6b8a853 Sebastian Fricke 2019-04-16 10:25:49
Added an optimization for the initial directory for Linux 58b340605cba0603520ada8a184cc9fba5f8c3b8 Sebastian Fricke 2019-04-16 10:22:18
Fixed a typo in the build script f7943d8b2c33b89b083380902f1b1281366a12b2 Sebastian Fricke 2019-04-16 08:13:51
Added a build script for Linux + removed the finished executables 8fcf82d5de859895d29a7f355c0d49700beb4e38 Sebastian Fricke 2019-04-16 08:10:13
Changed the EAN type from UPC to GTIN_13 which is the correct one. ea74c1d8c001ae6895f07bbecbcb9a0898400b95 Sebastian Fricke 2019-04-15 13:04:54
fixed a bug with item_name + changed the item_name assignment to include the variation name instead of the parent name 7dedb2bb9afac7d5625ccbf9c05f6ff4b1b1e5e1 LagerBadel PC:Magdalena 2019-04-15 12:32:33
Added usage instructions in english and german language. e2f291e2a00ac9283ab9d843e652d7b77fa6bbaf Sebastian Fricke 2019-04-15 09:59:36
Added usage instructions in english and german language. 30646f203ae8847cfa4971cb62187dca8406b8d7 Sebastian Fricke 2019-04-15 09:58:26
Fixed small compilation mistakes concerning positional arguments dc011ec52cf578e2910edde1aeacb893bb2e57f9 Sebastian Fricke 2019-04-15 07:16:14
Fixed a problem with the Upload folder when the executable is within its Folder outside of the root 6ca74a5bbbf13036405c654225de2540cddf2ed0 Sebastian Fricke 2019-04-15 07:02:13
Small improvements with the error handling inside item_upload.py 8d8361aa6ca7fca69407fb6c2f7450a9fd3ad40d LagerBadel PC:Magdalena 2019-04-12 12:31:39
Fixed the Windows Version because of corrupted Sym Links from the Windows Version 21c1d49e6508a27e3ba86741843c4141e09be2ee Sebastian Fricke 2019-04-12 11:57:28
The push from the windows machine corrupted the Linux Version, it is now re compiled. 1a642842228b959ad9ca1253b6e0df25d75e3d67 Sebastian Fricke 2019-04-12 09:34:27
Commit 4ab9bcd988f9eb26647748a8f80f25c8c5b7f2e2 - Changed the price upload to identify items that are not in plentymarkets and added a webshop price
Author: Sebastian Fricke
Author date (UTC): 2019-05-03 09:18
Committer name: Sebastian Fricke
Committer date (UTC): 2019-05-03 09:18
Parent(s): 84f93694fe0c67972ad951649d9f6f0d577d3e29
Signing key:
Tree: 69e8aefb73bca5c81174af71cefb4b95493737c7
File Lines added Lines deleted
packages/stock_upload.py 58 7
packages/variation_upload.py 0 4
File packages/stock_upload.py changed (mode: 100644) (index 037a228..c261e71)
... ... def priceUpload(flatfile, export, folder):
41 41 # The column header names # The column header names
42 42 column_names = ['VariationID', 'IsNet', 'VariationPrice', 'SalesPriceID'] column_names = ['VariationID', 'IsNet', 'VariationPrice', 'SalesPriceID']
43 43
44 price_id = ['1', '4']
44 prices = {
45 'price':{'id':'1', 'value':''},
46 'ebay':{'id':'3', 'value':''},
47 'amazon':{'id':'4', 'value':''},
48 'webshop':{'id':'5', 'value':''}
49 }
50
45 51 # create a Data Dictionary and fill it with the necessary values from the # create a Data Dictionary and fill it with the necessary values from the
46 52 # flatfile # flatfile
47 53 Data = SortedDict() Data = SortedDict()
 
... ... def priceUpload(flatfile, export, folder):
49 55 with open(flatfile, mode='r') as item: with open(flatfile, mode='r') as item:
50 56 reader = DictReader(item, delimiter=";") reader = DictReader(item, delimiter=";")
51 57 for row in reader: for row in reader:
52 if(row['external_product_id']):
53 for ident in price_id:
54 values = ['', 0, row['standard_price'], ident]
55 Data[row['item_sku']] = SortedDict(zip(column_names, values))
58 # Make sure that there is price even at parents
59 if(not( row['standard_price'] )):
60 print("row:{0} doesnt have a price!".format(row['item_sku']))
61 for scndrow in reader:
62 if(row['parent_child'] == 'parent'):
63 if(scndrow['parent_child'] == 'child' and scndrow['standard_price'] and row['item_sku'] == scndrow['parent_sku']):
64 row['standard_price'] = scndrow['standard_price']
65 break
66 elif(row['parent_child'] == 'child'):
67 if(scndrow['parent_child'] == 'child' and scndrow['standard_price'] and row['parent_sku'] == scndrow['parent_sku']):
68 row['standard_price'] = scndrow['standard_price']
69 break
70 if(row['standard_price']):
71 for price in prices:
72 if(prices[ price ]['id'] == '3'):
73 # Ebay price calculation
74 prices[ price ]['value'] = ( int( round( float( row['standard_price'] ) - (float( row['standard_price'] ) * 0.10) ) ) - 0.05 )
75 if(prices[ price ]['id'] == '5'):
76 # Webshop price calculation
77 prices[ price ]['value'] = ( int( round( float( row['standard_price'] ) - (float( row['standard_price'] ) * 0.16666666) ) ) - 0.05 )
78 else:
79 prices[ price ]['value'] = row['standard_price']
80 values = ['', 0, prices[ price ]['value'], prices[ price ]['id']]
81
82 print("row:{0}, id:{1}, value:{2}".format(row['item_sku'], prices[price]['id'], prices[price]['value']))
83 Data[row['item_sku'] + '_' + price] = SortedDict(zip(column_names, values))
84 else:
85 print("{0} doesn't have a price!\n".format(row['item_sku']))
56 86
57 87 with open(export, mode='r') as item: with open(export, mode='r') as item:
58 88 reader = DictReader(item, delimiter=";") reader = DictReader(item, delimiter=";")
59 89 for row in reader: for row in reader:
60 if(row['VariationNumber'] in [*Data]):
61 Data[row['VariationNumber']]['VariationID'] = row['VariationID']
90 for price in prices:
91 if((row['VariationNumber'] + '_' + price) in [*Data]):
92 Data[row['VariationNumber'] + '_' + price]['VariationID'] = row['VariationID']
93
94 # Open the flatfile again to check for items that didn't have variationID
95 with open(flatfile, mode='r') as item:
96 reader = DictReader(item,delimiter=';')
97 for row in reader:
98 for price in prices:
99 sku_price = row['item_sku'] + '_' + price
100 if(( sku_price ) in [*Data]):
101 if(not( Data[sku_price]['VariationID'] )):
102 print("sku: {0} has no VariationID!".format(row['item_sku']))
103 eraseKey(Data, sku_price)
62 104
63 105 output_path = variation_upload.writeCSV(Data, 'SalesPriceVariation', column_names, folder) output_path = variation_upload.writeCSV(Data, 'SalesPriceVariation', column_names, folder)
106
107 def eraseKey(dictionary, key):
108 if isinstance(dictionary, dict):
109 if key in dictionary:
110 dictionary.pop(key)
111 else:
112 print("Deletion failed {0} was not in the dictionary".format(key))
113 else:
114 print("Deletion failed for {0}".format(key))
File packages/variation_upload.py changed (mode: 100644) (index 735f072..e41d0f2)
... ... def EANUpload(flatfile, export, stocklist, folder):
220 220 if(barcode == 'FNSKU'): if(barcode == 'FNSKU'):
221 221 code = row['fnsku'] code = row['fnsku']
222 222
223 if(not(code)):
224 #raise EmptyFieldWarning('barcode(FNSKU)')
225 print("Keine FNSKU\n")
226
227 223 if(code): if(code):
228 224 Data[row['MASTER'] + barcode]['Code'] = code Data[row['MASTER'] + barcode]['Code'] = code
229 225
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/initBasti/Amazon2PlentySync

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/initBasti/Amazon2PlentySync

Clone this repository using git:
git clone git://git.rocketgit.com/user/initBasti/Amazon2PlentySync

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main