예제 #1
0
def data_in(data_type, directory_name):
    #    type_list = ['Node', 'SKU']

    if data_type == 'grainger_query':
        search_data = input(
            'Input Blue node ID or hit ENTER to read from file: ')
    elif data_type == 'yellow':
        search_data = input(
            'Input Yellow node ID or hit ENTER to read from file: ')
    elif data_type == 'gws_query':
        search_data = input(
            'Input GWS terminal node ID or ENTER to read from file: ')
    elif data_type == 'sku':
        search_data = input('Input SKU or hit ENTER to read from file: ')
    elif data_type == 'value':
        search_data = input('Input attribute value to search for: ')
    elif data_type == 'name':
        search_data = input('Input attribute name to search for: ')
    elif data_type == 'supplier':
        search_data = input('Input Supplier ID to search for: ')
    elif data_type == 'uom_group':
        search_data = input('Input UOM Group ID to search for: ')
    elif data_type == 'uom_val':
        search_data = input('Input UOM Value to search for: ')

    if search_data != "":
        search_data = search_data.strip()
        search_data = [search_data]
        return search_data

    else:
        file_data = settings.get_file_data()

        if data_type == 'sku':
            search_data = [row[0] for row in file_data[1:]]
            return search_data
        elif data_type == 'yelow':
            search_data = [str(row[0]) for row in file_data[1:]]
            return search_data
        else:
            search_data = [int(row[0]) for row in file_data[1:]]
            return search_data
def data_in(data_type, directory_name):
    #    type_list = ['Node', 'SKU']

    if data_type == 'grainger_query':
        search_data = input(
            'Input Blue node ID or hit ENTER to read from file: ')
    elif data_type == 'gws_query':
        search_data = input(
            'Input GWS terminal node ID or ENTER to read from file: ')

    if search_data != "":
        search_data = search_data.strip()
        search_data = [search_data]
        return search_data

    else:
        file_data = settings.get_file_data()

        search_data = [int(row[0]) for row in file_data[1:]]
        return search_data
예제 #3
0
def data_in(data_type, directory_name):
    
    if data_type == 'node':
        search_data = input('Input Blue node ID or hit ENTER to read from file: ')

    elif data_type == 'yellow':
        search_data = input('Input Yellow node ID or hit ENTER to read from file: ')

    elif data_type == 'sku':
        search_data = input ('Input SKU or hit ENTER to read from file: ')

    elif data_type == 'value':
        search_data = input ('Input attribute value to search for: ')

    elif data_type == 'name':
        search_data = input ('Input attribute name to search for: ')

    elif data_type == 'supplier':
        search_data = input ('Input Supplier ID to search for: ')
        
    if search_data != "":
        search_data = [search_data]
        return search_data
    else:
        file_data = settings.get_file_data()

        if data_type == 'node':
            search_data = [int(row[0]) for row in file_data[1:]]
            return search_data

        elif data_type == 'yellow':
            search_data = [str(row[0]) for row in file_data[1:]]
            return search_data

        elif data_type == 'sku':
            search_data = [row[0] for row in file_data[1:]]
            return search_data        
예제 #4
0
def data_in(data_type, directory_name):
#    type_list = ['Node', 'SKU']
    
    if data_type == 'category':
        search_data = input ('Input WS category ID or ENTER to read from file: ')
    if data_type == 'node':
        search_data = input ('Input WS terminal node ID or ENTER to read from file: ')        
    elif data_type == 'sku':
        search_data = input ('Input SKU or hit ENTER to read from file: ')
    elif data_type == 'supplier':
        search_data = input ('Input Supplier ID to search for: ')
        
    if search_data != "":
        search_data = search_data.strip()
        search_data = [search_data]
    else:
        file_data = settings.get_file_data()

        if data_type == 'sku':
            search_data = [row[0] for row in file_data[1:]]
        else:
            search_data = [int(row[0]) for row in file_data[1:]]

    return search_data
    	AND tax_att.deleted = false
        AND tax_att."allowedValues" IS NOT NULL
        AND tax_att."dataType" = {}    
        
        AND tprod_value."productId" IN ({})
"""


print ('Choose SKU list to transpose')

prod_id_list = pd.DataFrame()
gov_num = 0
gov_allow_text = 0
gov_allow_num = 0

file_data = settings.get_file_data()
sku_list = [row[0] for row in file_data[1:]]

start_time = time.time()

sku_list = [each_string.upper() for each_string in sku_list]
    
if len(sku_list)>4000:
    num_lists = round(len(sku_list)/4000, 0)
    num_lists = int(num_lists)

    if num_lists == 1:
        num_lists = 2
    print('running SKUs in {} batches'.format(num_lists))

    size = round(len(sku_list)/num_lists, 0)