Exemplo n.º 1
0
    def __get_unmatched(self, item: dict):
        unmatched = {}
        for (key, value) in item.items():
            if not Utils.empty(value):
                value = Utils.clean_if_nan(value)
                if value is not None:
                    unmatched[key] = value

        return unmatched
Exemplo n.º 2
0
    def __get_unmatched(self, data, labels):
        unmatched = {}
        for ix, col in enumerate(data):
            if col is not None:
                if self.__has(labels, ix):
                    label = labels[ix]
                else:
                    label = str(ix)

                col = Utils.clean_if_nan(col)
                if col is not None and not Utils.empty(col):
                    unmatched[label] = col

        return unmatched
Exemplo n.º 3
0
    def __get_unmatched(self, xmlitem, inputunmatched=None):
        unmatched = {}
        if inputunmatched is not None:
            unmatched = inputunmatched

        for ix, item in enumerate(list(xmlitem)):
            if self.__has_children(item):
                unmatched[item.tag] = {}
                self.__get_unmatched(item, unmatched[item.tag])
            else:
                value = Utils.clean_if_nan(item.text)
                if value is not None and not Utils.empty(value):
                    unmatched[item.tag] = value

        return unmatched