Complex sorting of nested data
You can use a list comprehension to avoid verbosity:

        items = []
        for value in obj:
            if isinstance(value, dict) or isinstance(value, list):
                items.append(comp_sort(value, sort_order))
            else:
                items.append(value)
        return items


Becomes:

is_dict_or_list = isinstance(value, dict) or isinstance(value, list) 
return [comp_sort(value, sort_order) if is_dict_or_list else value
               for value in obj ]


Remember to specify:

except ExpectedError:


And not

except:


The latter will swallow anything and harden debugging.