code: def convert_type(self, value, spec):
          
          data_type = spec.get('type', 'string').lower().strip()
          if data_type in ['bool', 'boolean']:
              return value.lower() in BOOL_TRUISH
          elif data_type in ['int', 'integer']:
              try:
                  return int(value)
              except (ValueError, TypeError):
                  return None
          elif data_type in ['float', 'decimal', 'real']:
              try:
                  return float(value)
              except (ValueError, TypeError):
                  return None
          elif data_type in ['date', 'datetime', 'timestamp']:
              if 'format' in spec:
                  format_list = self._get_date_format_list(spec.get('format'))
                  if format_list is None:
                      raise MappingException(
                          '%s format mapping is not valid: %r' %
                          (spec.get('column'), spec.get('format'))
                      )
                  for format, precision in format_list:
                      try:
                          return {'value': datetime.strptime(value, format),
                                  'value_precision': precision}
                      except (ValueError, TypeError):
                          pass
                  return None
              else:
                  try:
                      return parser.parse(value)
                  except (ValueError, TypeError):
                      return None
          elif data_type == 'file':
              try:
                  return self._get_file(value)
              except:
                  raise
          return value
docs: Some well-educated format guessing.