If you have a list of dictionaries and you would like to sort the entries according to one or more of the dictionary values, you can use itemgetter from operator.

from operator import itemgetter

entries = [
  {"name": "Sarah", "surname": "Connor", "uid": 104},
  {"name": "Morticia", "surname": "Addams", "uid": 174},
  {"name": "Sal", "surname": "Gomez", "uid": 345},
  {"name": "Kawhi", "surname": "Leonard", "uid": 2}
]

entries_by_name = sorted(entries, key=itemgetter("name"))
entries_by_uid = sorted(entries, key=itemgetter("uid"))

entries_by_name
## [{'name': 'Kawhi', 'surname': 'Leonard', 'uid': 2}, {'name': 'Morticia', 'surname': 'Addams', 'uid': 174}, {'name': 'Sal', 'surname': 'Gomez', 'uid': 345}, {'name': 'Sarah', 'surname': 'Connor', 'uid': 104}]
entries_by_uid
## [{'name': 'Kawhi', 'surname': 'Leonard', 'uid': 2}, {'name': 'Sarah', 'surname': 'Connor', 'uid': 104}, {'name': 'Morticia', 'surname': 'Addams', 'uid': 174}, {'name': 'Sal', 'surname': 'Gomez', 'uid': 345}]
entries_by_uid_and_surname = sorted(entries, key=itemgetter("uid", "surname"))
entries_by_uid_and_surname
## [{'name': 'Kawhi', 'surname': 'Leonard', 'uid': 2}, {'name': 'Sarah', 'surname': 'Connor', 'uid': 104}, {'name': 'Morticia', 'surname': 'Addams', 'uid': 174}, {'name': 'Sal', 'surname': 'Gomez', 'uid': 345}]

You can also use operations with itemgetter.

min(entries, key=itemgetter("uid"))
## {'name': 'Kawhi', 'surname': 'Leonard', 'uid': 2}