import collections


def sort_dict(dictionary):
    """
    Return a dictionary as an OrderedDict sorted by keys.
    """
    items = sorted(dictionary.items())
    return collections.OrderedDict(items)