def find_metadata_item(metadata_items, key_name):
    """ Finds a metadata entry by the key name. """

    for item in metadata_items:
        if item['key'] == key_name:
            return item

    return None