import collections


def sort_dict_by_key(d: dict) -> collections.OrderedDict:
    """
    Sorts a dictionary by key
    :param d: Dictionary
    :return: Returns an OrderedDict
    """
    return collections.OrderedDict(
        {
            k: v for k, v in sorted(d.items())
        }
    )