I have the following data structure (coming from a piece of code I can't modify):
{
'key2':[{'name':'Oliver','value':1}, {'name':'Rambo','value':2}],
'key1':[{'name':'Robert','value':4}, {'name':'Rambo','value':0}],
'Ali':[{'name':'Oliver','value':1}, {'name':'Robert','value':0}]
}
I want to sort this list by 'key name' and not by key value. So if I apply a sort on the previous list the output should be:
{
'Ali':[{'name':'Oliver','value':1}, {'name':'Robert','value':0}],
'key1':[{'name':'Robert','value':4}, {'name':'Rambo','value':0}],
'key2':[{'name':'Oliver','value':1}, {'name':'Rambo','value':2}]
}
I found a lot of litterature about how sorting by key value, but almost nothing regarding sorting by key name. What is the most efficient method to do that?