def collect_citation_metadata(metadata: dict) -> dict:
    """Produces the data stored in the CITATION.cff file

    Args:
      metadata: The project metadata read from the YAML file. This is the main
        source of information for this function.

    Returns:
      Citation data in the [Citation File Format](https://github.com/citation-file-format/citation-file-format)
    """
    citation_authors = []
    for author_tier in ['Core', 'Developers', 'Contributors']:
        for author in metadata['Authors'][author_tier]['List']:
            family_names, given_names = author['Name'].split(', ')
            citation_author = {
                'family-names': family_names,
                'given-names': given_names,
            }
            if 'Orcid' in author:
                citation_author['orcid'] = ("https://orcid.org/" +
                                            author['Orcid'])
            if 'Affiliations' in author and len(author['Affiliations']) > 0:
                citation_author['affiliation'] = ' and '.join(
                    author['Affiliations'])
            citation_authors.append(citation_author)
    return {
        'cff-version':
        "1.1.0",
        'message':
        "Please cite SpECTRE in any publications that make use of its code "
        "or data. Cite the latest version that you use in your publication. "
        "The citation for this version is listed below.",
        'title':
        metadata['Name'],
        'url':
        metadata['Homepage'],
        'repository-code':
        "https://github.com/" + metadata['GitHub'],
        'version':
        metadata['Version'],
        'date-released':
        metadata['PublicationDate'],
        'doi':
        metadata['Doi'],
        'authors':
        citation_authors,
        'keywords':
        metadata['Keywords'],
        'license':
        metadata['License'],
    }