# -*- coding: utf-8 -*-
"""
Created on Tue Jan  5 15:56:20 2021

@author: xcxg109
"""

import pandas as pd
import numpy as np
from GWS_query import GWSQuery
import os
from tkinter.filedialog import askdirectory 
import glob
import time

gws = GWSQuery()
pd.options.mode.chained_assignment = None

ws_category="""
    SELECT cat.name

    FROM    taxonomy_category as cat
    
    WHERE {} IN ({})
"""

def get_col_widths(df):
    #find maximum length of the index column
    idx_max = max([len(str(s)) for s in df.index.values] + [len(str(df.index.name))])
    #Then concatenate this to max of the lengths of column name and its values for each column
    
コード例 #2
0
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 19 10:10:23 2019

@author: xcxg109
"""

import pandas as pd
from GWS_query import GWSQuery
from grainger_query import GraingerQuery
from queries_MATCH import gamut_basic_query, grainger_attr_query, grainger_name_query, grainger_basic_query

gcom = GraingerQuery()

gamut = GWSQuery()


def gamut_skus(grainger_skus):
    """get basic list of gamut SKUs to pull the related PIM nodes"""
    gamut_sku_list = pd.DataFrame()

    sku_list = grainger_skus['Grainger_SKU'].tolist()

    if len(sku_list) > 20000:
        num_lists = round(len(sku_list) / 20000, 0)
        num_lists = int(num_lists)

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