d_ascending = OrderedDict(sorted(list(d.items()), key=lambda kv: kv[1]['key3']))
d_descending = OrderedDict(sorted(list(d.items()), key=lambda kv: kv[1]['key3'],
    reverse=True))
python dictionary sorting in descending order based on values