gfw.common.sorting#

Utilities for sorting data structures.

Functions

sort_dicts

Recursively sorts dict keys to get consistent ordering for comparison.

sort_dicts(obj)[source]#

Recursively sorts dict keys to get consistent ordering for comparison.

Lists, tuples, and other types are returned unchanged (except their contents get sorted recursively if they are dicts).

Parameters:

obj (Any) – Any nested structure (dict, list, tuple, or other).

Returns:

A new structure with dict keys sorted recursively.

Return type:

Any