def process_contributors(authors, emails): """Process authors and add author emails If multiple authors and one email, put email in a new author """ emails = emails.split(',') authors = clean_authors(authors) contributor_list = [] append_emails = len(authors) == 1 and len(emails) == 1 and not emails[ 0] == u'' # append the email to the author only when 1 record is observed for i, author in enumerate(authors): if is_organization(author): contributor = {'name': author} else: contributor = parse_name(author) if append_emails: contributor['email'] = emails[i] contributor_list.append(contributor) if not append_emails and emails[0] != u'': for email in emails: contributor = {'name': '', 'email': email} contributor_list.append(contributor) return contributor_list
def process_contributors(authors, emails): """Process authors and add author emails If multiple authors and one email, put email in a new author """ emails = emails.split(',') authors = clean_authors(authors) contributor_list = [] append_emails = len(authors) == 1 and len(emails) == 1 and not emails[0] == u'' # append the email to the author only when 1 record is observed for i, author in enumerate(authors): if is_organization(author): contributor = { 'name': author } else: contributor = parse_name(author) if append_emails: contributor['email'] = emails[i] contributor_list.append(contributor) if not append_emails and emails[0] != u'': for email in emails: contributor = { 'name': '', 'email': email } contributor_list.append(contributor) return contributor_list
def process_contributors(authors): contributor_list = [] for person in authors: contributor = parse_name(person['fullname']) contributor['sameAs'] = [url_from_guid(person['url'])] contributor_list.append(contributor) return contributor_list