Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
source_id=item.get('source-id'), author_ids=info.get("auth_ids"),
aggregationType=item.get('prism:aggregationType'),
issueIdentifier=item.get('prism:issueIdentifier'),
pageRange=item.get('prism:pageRange'),
author_afids=info.get("auth_afid"), fund_no=item.get('fund-no'),
affiliation_country=info.get("aff_country"),
citedby_count=item.get('citedby-count'),
openaccess=item.get('openaccess'), eIssn=item.get('prism:eIssn'),
author_count=item.get('author-count', {}).get('$'),
affiliation_city=info.get("aff_city"), afid=info.get("afid"),
description=item.get('dc:description'), pii=item.get('pii'),
authkeywords=item.get('authkeywords'), eid=item.get('eid'),
fund_acr=item.get('fund-acr'), pubmed_id=item.get('pubmed-id'))
out.append(new)
# Finalize
check_integrity(out, self.integrity, self.action)
return out or None
fields = 'eid name variant documents city country parent'
aff = namedtuple('Affiliation', fields)
check_field_consistency(self.integrity, fields)
# Parse elements one-by-one
out = []
for item in self._json:
name = item.get('affiliation-name')
variants = [d.get('$', "") for d in item.get('name-variant', [])
if d.get('$', "") != name]
new = aff(eid=item.get('eid'), variant=";".join(variants),
documents=item.get('document-count', '0'), name=name,
city=item.get('city'), country=item.get('country'),
parent=item.get('parent-affiliation-id'))
out.append(new)
# Finalize
check_integrity(out, self.integrity, self.action)
return out or None
if isinstance(fields, dict):
fields = [fields]
areas = ["{} ({})".format(d.get('@abbrev', ''),
d.get('@frequency', ''))
for d in fields]
new = auth(eid=item.get('eid'), initials=name.get('initials'),
surname=name.get('surname'), areas="; ".join(areas),
givenname=name.get('given-name'),
documents=item.get('document-count', '0'),
affiliation=aff.get('affiliation-name'),
affiliation_id=aff.get('affiliation-id'),
city=aff.get('affiliation-city'),
country=aff.get('affiliation-country'))
out.append(new)
# Finalize
check_integrity(out, self.integrity, self.action)
return out or None