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)
current working version 10-04-19 f57799f6815c8c76217f64e292d6cf61e0deffb7 Sebastian Fricke 2019-04-10 14:40:36
Changed the collection_name field to the newer seasons field in the property upload b13a2282d20e97f6f414e02ace9673246678adc4 Sebastian Fricke 2019-03-29 09:59:05
Added a feature upload and removed a test print from the barcode upload b04dc65a93ff10c650cdaf48d1a7922ff4769ecc Sebastian Fricke 2019-03-28 14:57:54
Added FNSKU code and removed freetext fields to replace them with properties 4f77496d60be1afbd90a7279b14643267b4430cc Sebastian Fricke 2019-03-27 11:09:55
Added FNSKU code and removed freetext fields to replace them with properties 3d76e8769337dd96fa02503eb242fd192f3c148d Sebastian Fricke 2019-03-27 11:06:41
Update to property Upload because it isn't necessary to have a property for each material 37c01ce472dc85a9f7a39bd164a2ea53c28b4955 Sebastian Fricke 2019-03-18 16:08:14
added a filter for items with only 1 size that currently works with single parent child combinations fd3bf2b659614d5518884eb3da77b564cd0018eb Sebastian Fricke 2019-02-28 16:08:57
Market connection adjusted to AmazonFBA 1feb4b2e96c6a55ad0494696fd18fd6fb42babb0 Sebastian Fricke 2019-02-25 12:21:05
current version Feb 2019 00b24836dd378f21942ed323c2b66f928b9fb4c4 Sebastian Fricke 2019-02-25 09:00:00
Changes to fit to the new flatfile format 91cd339571f607e88f6e922f1a47630c4c8d62a7 Sebastian Fricke 2019-02-08 13:28:02
Small removal of redundant code b271de0b1be1d83be088b00a35b5618af088b58a Sebastian Fricke 2019-01-30 18:08:15
General improvements and property upload bb48084db4359210eb892a04f1322f6fda822bef Sebastian Fricke 2019-01-30 17:43:32
Fixed scripts according to dataformat changes + readme dec28d9e6ff5c5c903d5ca01a969e661d43b66c6 Sebastian Fricke 2019-01-29 21:08:04
Working Checkboxes and file import 25378c68a6220c1c6570642920e6150a50415153 Sebastian Fricke 2019-01-29 21:03:23
Added checkboxes, descriptions, import and runbutton 2021f0960e70c8c229ec08488165dc01b998a6e0 Sebastian Fricke 2019-01-27 22:19:18
Added market connection, cosmetics in product import c9a771d5e7a3a80adc650e773c568e00dd8e2aea Sebastian Fricke 2019-01-23 15:01:47
Amazon Data Upload 33dbd0ed6945c01d8917ceae3cf3964f051a2288 Sebastian Fricke 2019-01-22 14:43:39
Readme started, amazon sku upload, vari upload, images f43a9e83598c3e4623bcb08667e2b4e649b2cdea Sebastian Fricke 2019-01-22 10:44:40
Amazon SKU Upload 8586da2ae91d49c81a0d9b6ff220c8a1b1b011a6 Sebastian Fricke 2019-01-16 18:36:54
Inital Commit with current working version of the CLI Tool and the work in progress of the GUI. 207fef4277f7c169aa79eb39ec1aaaab258b888c Sebastian Fricke 2019-01-16 09:47:43
Commit f57799f6815c8c76217f64e292d6cf61e0deffb7 - current working version 10-04-19
Author: Sebastian Fricke
Author date (UTC): 2019-04-10 14:40
Committer name: Sebastian Fricke
Committer date (UTC): 2019-04-10 14:40
Parent(s): 66c315538e25d67de02bff82b4109af99438a852
Signing key:
Tree: cd3db4cfcd60ef37a19ed2c970a157cbcda5ff7c
File Lines added Lines deleted
packages/amazon_data_upload.py 2 1
packages/item_upload.py 69 59
product_import.py 9 8
File packages/amazon_data_upload.py changed (mode: 100644) (index 527f9cc..bf962cc)
... ... def featureUpload(flatfile, feature, feature_id):
128 128
129 129 for row in reader: for row in reader:
130 130 if(row['parent_child'] == 'child'): if(row['parent_child'] == 'child'):
131 print(row['item_sku'] + "\t")
131 132 values = [ values = [
132 133 row['item_sku'], feature_id, row['item_sku'], feature_id,
133 134 '1', '1', '1', '1',
134 135 row[feature] row[feature]
135 136 ] ]
136 137
137 Data['item_sku'] = dict(zip(column_names, values))
138 Data[row[ 'item_sku' ]] = dict(zip(column_names, values))
138 139
139 140 variation_upload.writeCSV(dataobject=Data, name=feature.upper(), columns=column_names) variation_upload.writeCSV(dataobject=Data, name=feature.upper(), columns=column_names)
File packages/item_upload.py changed (mode: 100644) (index 95657c0..a27c0eb)
... ... def itemUpload(flatfile, intern):
46 46 # transform the text format to integer in order to adjust the # transform the text format to integer in order to adjust the
47 47 # height, width, length numbers from centimeter to milimeter # height, width, length numbers from centimeter to milimeter
48 48
49 if(row['parent_child'] == 'parent'):
50 try:
51 if(row['package_height'] and
52 row['package_length'] and
53 row['package_width']):
54
55 row['package_height'] = int(row['package_height'])
56 row['package_length'] = int(row['package_length'])
57 row['package_width'] = int(row['package_width'])
58
59 # if the number is a floating point number it has to be
60 # transformed into a float first befor the integer conversion
61 except ValueError as err:
62 row['package_height'] = int(float(row['package_height']))
63 row['package_length'] = int(float(row['package_length']))
64 row['package_width'] = int(float(row['package_width']))
65
66 except ValueError as err:
67 print(err)
68 print("/nPlease copy the values for height, length, width",
69 "and weight\nfrom the children to the parent",
70 "variation in the flatfile.\n")
71 exit()
72
73 # get the keywords from the flatfile if it is a old flatfile
74 # combine the keyword columns into a single one
75 # after that check the size of the keywords
76 # because the maximum for amazon is 250byte
77 # if('generic_keywords1' in headers):
78 # if(row['generic_keywords1']):
79 # keywords = ''
80 # try:
81 # keywords = str(row['generic_keywords1'] + '' +
82 # row['generic_keywords2'] + '' +
83 # row['generic_keywords3'] + '' +
84 # row['generic_keywords4'] + '' +
85 # row['generic_keywords5'])
86 # except Exception as err:
87 # print(err)
88 # print("The combination of the keywords failed!")
89 if(row['generic_keywords']):
90 keywords = row[ 'generic_keywords' ]
91
92 try:
93 values = ['', row['item_sku'], row['package_length'] * 10,
94 row['package_width'] * 10,
95 row['package_height'] * 10,
96 row['package_weight'], row['item_name'],
97 '104', '', '62', row['brand_name'].upper(), '3',
98 row['feed_product_type'], '',
99 row['product_description'], keywords, 'de',
100 '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 9, 1]
101
102 except Exception as err:
103 print(err)
104 Data[row['item_sku']] = SortedDict(zip(column_names, values))
49 try:
50 if(row['parent_child'] == 'parent'):
51 try:
52 if(row['package_height'] and
53 row['package_length'] and
54 row['package_width']):
55
56 row['package_height'] = int(row['package_height'])
57 row['package_length'] = int(row['package_length'])
58 row['package_width'] = int(row['package_width'])
59
60 # if the number is a floating point number it has to be
61 # transformed into a float first befor the integer conversion
62 except ValueError as err:
63 row['package_height'] = int(float(row['package_height']))
64 row['package_length'] = int(float(row['package_length']))
65 row['package_width'] = int(float(row['package_width']))
66
67 except ValueError as err:
68 print(err)
69 print("/nPlease copy the values for height, length, width",
70 "and weight\nfrom the children to the parent",
71 "variation in the flatfile.\n")
72 exit()
73
74 # get the keywords from the flatfile if it is a old flatfile
75 # combine the keyword columns into a single one
76 # after that check the size of the keywords
77 # because the maximum for amazon is 250byte
78 # if('generic_keywords1' in headers):
79 # if(row['generic_keywords1']):
80 # keywords = ''
81 # try:
82 # keywords = str(row['generic_keywords1'] + '' +
83 # row['generic_keywords2'] + '' +
84 # row['generic_keywords3'] + '' +
85 # row['generic_keywords4'] + '' +
86 # row['generic_keywords5'])
87 # except Exception as err:
88 # print(err)
89 # print("The combination of the keywords failed!")
90 if(row['generic_keywords']):
91 keywords = row[ 'generic_keywords' ]
92
93 try:
94 values = ['', row['item_sku'], row['package_length'] * 10,
95 row['package_width'] * 10,
96 row['package_height'] * 10,
97 row['package_weight'], row['item_name'],
98 '104', '', '62', row['brand_name'].upper(), '3',
99 row['feed_product_type'], '',
100 row['product_description'], keywords, 'de',
101 '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 9, 1]
102
103 except Exception as err:
104 print(err)
105 Data[row['item_sku']] = SortedDict(zip(column_names, values))
106 except KeyError as err:
107 print(err)
108 return row['item_sku']
105 109
106 110 # open the intern number csv to get the item ID # open the intern number csv to get the item ID
107 111 with open(intern, mode='r') as item: with open(intern, mode='r') as item:
 
... ... def itemPropertyUpload(flatfile, export):
131 135 , 'supplier_declared_dg_hz_regulation' , 'supplier_declared_dg_hz_regulation'
132 136 , 'department_name', 'variation_theme' , 'department_name', 'variation_theme'
133 137 , 'seasons', 'material_composition' , 'seasons', 'material_composition'
134 , 'outer_material_type']
138 , 'outer_material_type', 'collar_style'
139 , 'neck_size', 'pattern_type'
140 , 'sleeve_type']
135 141
136 142 # Assign the Plentymarkets property ID to the property_names # Assign the Plentymarkets property ID to the property_names
137 143 property_id = dict() property_id = dict()
 
... ... def itemPropertyUpload(flatfile, export):
143 149 , '14' , '14'
144 150 , '13', '12' , '13', '12'
145 151 , '11', '8' , '11', '8'
146 , '7']
152 , '7', '25'
153 , '26', '28'
154 , '29']
147 155
148 156 property_id = dict( zip(property_names, id_values) ) property_id = dict( zip(property_names, id_values) )
149 157
 
... ... def itemPropertyUpload(flatfile, export):
159 167 , row[property_names[8] + '1'] , row[property_names[8] + '1']
160 168 , row[property_names[9]], row[property_names[10]] , row[property_names[9]], row[property_names[10]]
161 169 , row[property_names[11]], row[property_names[12]] , row[property_names[11]], row[property_names[12]]
162 , row[property_names[13]]
170 , row[property_names[13]], row[property_names[14]]
171 , row[property_names[15]], row[property_names[16]]
172 , row[property_names[17]]
163 173 ] ]
164 174 except ValueError as err: except ValueError as err:
165 175 print("In property Upload: One of the values wasn't found : ", err) print("In property Upload: One of the values wasn't found : ", err)
File product_import.py changed (mode: 100644) (index 857c562..bf175f4)
1 1 from tkinter import Tk from tkinter import Tk
2 2 from tkinter.filedialog import askopenfilename from tkinter.filedialog import askopenfilename
3 from sys import exit
3 import sys
4 4 from packages.item_upload import itemUpload, itemPropertyUpload from packages.item_upload import itemUpload, itemPropertyUpload
5 5 # from packages.attribute_upload import attributeUpload # from packages.attribute_upload import attributeUpload
6 6 from packages.variation_upload import variationUpload, setActive, EANUpload, marketConnection from packages.variation_upload import variationUpload, setActive, EANUpload, marketConnection
7 7 from packages.stock_upload import stockUpload, priceUpload from packages.stock_upload import stockUpload, priceUpload
8 from packages.amazon_data_upload import amazonSkuUpload, amazonDataUpload, asinUpload
8 from packages.amazon_data_upload import amazonSkuUpload, amazonDataUpload, asinUpload, featureUpload
9 9 from packages.image_upload import imageUpload from packages.image_upload import imageUpload
10 10
11 11
 
... ... def main():
20 20 root.withdraw() root.withdraw()
21 21 sheet = askopenfilename() sheet = askopenfilename()
22 22 intern_number = askopenfilename() intern_number = askopenfilename()
23 erroritem = ''
23 24 print("spreadsheet csv containing the flatfile : ", sheet) print("spreadsheet csv containing the flatfile : ", sheet)
24 25 print("spreadsheet csv containing the intern numbers : ", intern_number) print("spreadsheet csv containing the intern numbers : ", intern_number)
25 26 try: try:
26 27 print("\nItem Upload\n") print("\nItem Upload\n")
27 itemUpload(sheet, intern_number)
28 except Exception as exc:
29 print(exc)
28 erroritem = itemUpload(sheet, intern_number)
29 except:
30 30 print("Item Upload failed!") print("Item Upload failed!")
31
31 print("Here: ", erroritem)
32 32 try: try:
33 33 print("\nVariation Upload\n") print("\nVariation Upload\n")
34 34 variationUpload(sheet, intern_number) variationUpload(sheet, intern_number)
 
... ... def main():
51 51 print("Something went wrong at the Export file import!") print("Something went wrong at the Export file import!")
52 52 print("spreadsheet csv containing the export : ", export) print("spreadsheet csv containing the export : ", export)
53 53 try: try:
54 print("Active, Merkmale & Price Upload")
54 print("Active, properties , features & price Upload")
55 featureUpload(sheet, 'color_map', 1)
55 56 setActive(sheet, export) setActive(sheet, export)
56 57 itemPropertyUpload(sheet, export) itemPropertyUpload(sheet, export)
57 58 priceUpload(sheet, export) priceUpload(sheet, export)
58 59 except FileNotFoundError as err: except FileNotFoundError as err:
59 60 print(err) print(err)
60 61 print("Missing Data, check if you have\n - a flatfile\n - a intern file table\n - export file from plentymarkets\n - a sheet with the stock numbers!\n") print("Missing Data, check if you have\n - a flatfile\n - a intern file table\n - export file from plentymarkets\n - a sheet with the stock numbers!\n")
61 exit()
62 sys.exit()
62 63 print("\nOpen your amazon storage report and save it as an csv.\n") print("\nOpen your amazon storage report and save it as an csv.\n")
63 64 stocklist = askopenfilename() stocklist = askopenfilename()
64 65 print("spreadsheet csv containing the current stock : ", stocklist) print("spreadsheet csv containing the current stock : ", stocklist)
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