def str2dicts(data):
 list_data = []
 list_data.append({})
 d = list_data[(-1)]
 lines = data.split('\n')
 for line in lines:
  line = line.strip()
  if (not line):
   d = {}
   list_data.append(d)
   d = list_data[(-1)]
   continue
  whitespace = line.find(' ')
  if (not whitespace):
   continue
  key = line[0:whitespace]
  value = line[(whitespace + 1):]
  d.update({key: value})
 list_data = [val for val in list_data if (val != {})]
 return list_data

def str2dicts ( data ) : list_data = [ ] list_data . append ( { } ) d = list_data [ ( - 1 ) ] lines = data . split ( '\n' ) for line in lines : line = line . strip ( ) if ( not line ) : d = { } list_data . append ( d ) d = list_data [ ( - 1 ) ] continue whitespace = line . find ( ' ' ) if ( not whitespace ) : continue key = line [ 0 : whitespace ] value = line [ ( whitespace + 1 ) : ] d . update ( { key : value } ) list_data = [ val for val in list_data if ( val != { } ) ] return list_data
create a list of dictionaries from a whitespace and newline delimited text .