natural_sort

sofia_redux.toolkit.utilities.func.natural_sort(string_list, reverse=False)[source]

Returns list sorted in a human friendly manner

Typical python sorting will sort as 1,10,11,.. 2,20,21 when sorting a list of strings. natural_sort will return the result 1,2,3…10,11,12,…,19,20,21,…

Parameters:
string_listlist of str

List of strings to sort

reversebool, optional

Reverse the sorting order

Returns:
list of str

Human sorted list of strings