Given parsed references build a list of ref objects

def build_ref_list(refs):
    """
    Given parsed references build a list of ref objects
    """
    ref_list = []
    for reference in refs:
        ref = ea.Citation()
        # Publcation Type
        utils.set_attr_if_value(ref, 'publication_type', reference.get('publication-type'))
        # id
        utils.set_attr_if_value(ref, 'id', reference.get('id'))
        # Article title
        utils.set_attr_if_value(ref, 'article_title', reference.get('full_article_title'))
        # Source
        utils.set_attr_if_value(ref, 'source', reference.get('source'))
        # Volume
        utils.set_attr_if_value(ref, 'volume', reference.get('volume'))
        # Issue
        utils.set_attr_if_value(ref, 'issue', reference.get('issue'))
        # First page
        utils.set_attr_if_value(ref, 'fpage', reference.get('fpage'))
        # Last page
        utils.set_attr_if_value(ref, 'lpage', reference.get('lpage'))
        # DOI
        utils.set_attr_if_value(ref, 'doi', reference.get('doi'))
        # Year
        utils.set_attr_if_value(ref, 'year', reference.get('year'))
        # Year date in iso 8601 format
        utils.set_attr_if_value(ref, 'year_iso_8601_date', reference.get('year-iso-8601-date'))
        # Can set the year_numeric now
        if ref.year_iso_8601_date is not None:
            # First preference take it from the iso 8601 date, if available
            try:
                ref.year_numeric = int(ref.year_iso_8601_date.split('-')[0])
            except ValueError:
                ref.year_numeric = None
        if ref.year_numeric is None:
            # Second preference, use the year value if it is entirely numeric
            if utils.is_year_numeric(ref.year):
                ref.year_numeric = ref.year
        # date-in-citation
        utils.set_attr_if_value(ref, 'date_in_citation', reference.get('date-in-citation'))
        # elocation-id
        utils.set_attr_if_value(ref, 'elocation_id', reference.get('elocation-id'))
        # uri
        utils.set_attr_if_value(ref, 'uri', reference.get('uri'))
        if not ref.uri:
            # take uri value from uri_text
            utils.set_attr_if_value(ref, 'uri', reference.get('uri_text'))
        # pmid
        utils.set_attr_if_value(ref, 'pmid', reference.get('pmid'))
        # isbn
        utils.set_attr_if_value(ref, 'isbn', reference.get('isbn'))
        # accession
        utils.set_attr_if_value(ref, 'accession', reference.get('accession'))
        # patent
        utils.set_attr_if_value(ref, 'patent', reference.get('patent'))
        # patent country
        utils.set_attr_if_value(ref, 'country', reference.get('country'))
        # publisher-loc
        utils.set_attr_if_value(ref, 'publisher_loc', reference.get('publisher_loc'))
        # publisher-name
        utils.set_attr_if_value(ref, 'publisher_name', reference.get('publisher_name'))
        # edition
        utils.set_attr_if_value(ref, 'edition', reference.get('edition'))
        # version
        utils.set_attr_if_value(ref, 'version', reference.get('version'))
        # chapter-title
        utils.set_attr_if_value(ref, 'chapter_title', reference.get('chapter-title'))
        # comment
        utils.set_attr_if_value(ref, 'comment', reference.get('comment'))
        # data-title
        utils.set_attr_if_value(ref, 'data_title', reference.get('data-title'))
        # conf-name
        utils.set_attr_if_value(ref, 'conf_name', reference.get('conf-name'))
        # Authors
        if reference.get('authors'):
            for author in reference.get('authors'):
                ref_author = {}
                eautils.set_if_value(ref_author, 'group-type', author.get('group-type'))
                eautils.set_if_value(ref_author, 'surname', author.get('surname'))
                eautils.set_if_value(ref_author, 'given-names', author.get('given-names'))
                eautils.set_if_value(ref_author, 'collab', author.get('collab'))
                if ref_author:
                    ref.add_author(ref_author)
        # Try to populate the doi attribute if the uri is a doi
        if not ref.doi and ref.uri:
            if ref.uri != eautils.doi_uri_to_doi(ref.uri):
                ref.doi = eautils.doi_uri_to_doi(ref.uri)
        # Append the reference to the list
        ref_list.append(ref)
    return ref_list