def sorted_dict(data):
 if (type(data) == OrderedDict):
  data = dict(data)
 if (type(data) == dict):
  data = OrderedDict(sorted(data.items(), key=(lambda t: t[0])))
 elif (type(data) == list):
  for count in range(len(data)):
   data[count] = OrderedDict(sorted(data[count].items(), key=(lambda t: t[0])))
 return data

def sorted_dict ( data ) : if ( type ( data ) == OrderedDict ) : data = dict ( data ) if ( type ( data ) == dict ) : data = OrderedDict ( sorted ( data . items ( ) , key = ( lambda t : t [ 0 ] ) ) ) elif ( type ( data ) == list ) : for count in range ( len ( data ) ) : data [ count ] = OrderedDict ( sorted ( data [ count ] . items ( ) , key = ( lambda t : t [ 0 ] ) ) ) return data
sorts a json and returns ordereddict .