'Parse a type to an other type'

def parse_data_type(self, index, **kwargs):

    if (not index.isValid()):
        return False
    try:
        if (kwargs['atype'] == 'date'):
            self._data[index.row()][index.column()] = datestr_to_datetime(self._data[index.row()][index.column()], kwargs['dayfirst']).date()
        elif (kwargs['atype'] == 'perc'):
            _tmp = self._data[index.row()][index.column()].replace('%', '')
            self._data[index.row()][index.column()] = (eval(_tmp) / 100.0)
        elif (kwargs['atype'] == 'account'):
            _tmp = self._data[index.row()][index.column()].replace(',', '')
            self._data[index.row()][index.column()] = eval(_tmp)
        elif (kwargs['atype'] == 'unicode'):
            self._data[index.row()][index.column()] = to_text_string(self._data[index.row()][index.column()])
        elif (kwargs['atype'] == 'int'):
            self._data[index.row()][index.column()] = int(self._data[index.row()][index.column()])
        elif (kwargs['atype'] == 'float'):
            self._data[index.row()][index.column()] = float(self._data[index.row()][index.column()])
        self.dataChanged.emit(index, index)
    except Exception as instance:
        print(instance)
