def get_valid_column_name(field):
 if (not REGEX_VALID_TB_FLD.match(field)):
  if re.match('^[0-9]', field):
   numbers = ['Zero', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine']
   field = (numbers[int(field[0])] + field[1:])
  field = INVALID_CHARS.sub('_', field)
 return field

def get_valid_column_name ( field ) : if ( not REGEX_VALID_TB_FLD . match ( field ) ) : if re . match ( '^[0-9]' , field ) : numbers = [ 'Zero' , 'One' , 'Two' , 'Three' , 'Four' , 'Five' , 'Six' , 'Seven' , 'Eight' , 'Nine' ] field = ( numbers [ int ( field [ 0 ] ) ] + field [ 1 : ] ) field = INVALID_CHARS . sub ( '_' , field ) return field
return a valid column name that follows pythons rules for identifiers .