def results(self):
        """A list of namedtuples in the form (eid doi pii pubmed_id title
        subtype creator afid affilname affiliation_city affiliation_country
        author_count author_names author_ids author_afids coverDate
        coverDisplayDate publicationName issn source_id eIssn aggregationType
        volume issueIdentifier article_number pageRange description
        authkeywords citedby_count openaccess fund_acr fund_no fund_sponsor).
        Field definitions correspond to
        https://dev.elsevier.com/guides/ScopusSearchViews.htm, except for
        afid, affilname, affiliation_city, affiliation_country, author_count,
        author_names, author_ids and author_afids:  These information are
        joined on ";".  In case an author has multiple affiliations, they are
        joined on "-" (e.g. Author1Aff;Author2Aff1-Author2Aff2).

        Notes
        -----
        The list of authors and the list of affiliations per author are
        deduplicated.
        """
        out = []
        fields = 'eid doi pii pubmed_id title subtype creator afid affilname '\
                 'affiliation_city affiliation_country author_count '\
                 'author_names author_ids author_afids coverDate '\
                 'coverDisplayDate publicationName issn source_id eIssn '\
                 'aggregationType volume issueIdentifier article_number '\
                 'pageRange description authkeywords citedby_count '\
                 'openaccess fund_acr fund_no fund_sponsor'
        doc = namedtuple('Document', fields)
        for item in self._json:
            info = {}
            # Parse affiliations
            try:
                info["affilname"] = _join(item['affiliation'], 'affilname')
                info["afid"] = _join(item['affiliation'], 'afid')
                info["aff_city"] = _join(item['affiliation'], 'affiliation-city')
                info["aff_country"] = _join(item['affiliation'],
                                            'affiliation-country')
            except KeyError:
                pass
            # Parse authors
            try:
                # Deduplicate list of authors
                authors = _deduplicate(item['author'])
                # Extract information
                surnames = _replace_none([d['surname'] for d in authors])
                firstnames = _replace_none([d['given-name'] for d in authors])
                info["auth_names"] = ";".join([", ".join([t[0], t[1]]) for t in
                                               zip(surnames, firstnames)])
                info["auth_ids"] = ";".join([d['authid'] for d in authors])
                affs = []
                for auth in authors:
                    aff = listify(_deduplicate(auth.get('afid', [])))
                    affs.append('-'.join([d['$'] for d in aff]))
                info["auth_afid"] = (';'.join(affs) or None)
            except KeyError:
                pass
            date = item.get('prism:coverDate')
            if isinstance(date, list):
                date = date[0].get('$')
            new = doc(article_number=item.get('article-number'),
                title=item.get('dc:title'), fund_sponsor=item.get('fund-sponsor'),
                subtype=item.get('subtype'), issn=item.get('prism:issn'),
                creator=item.get('dc:creator'), affilname=info.get("affilname"),
                author_names=info.get("auth_names"), doi=item.get('prism:doi'),
                coverDate=date, volume=item.get('prism:volume'),
                coverDisplayDate=item.get('prism:coverDisplayDate'),
                publicationName=item.get('prism:publicationName'),
                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['eid'],
                fund_acr=item.get('fund-acr'), pubmed_id=item.get('pubmed-id'))
            out.append(new)
        return out or None
def results ( self ) : out = [ ] fields = 'eid doi pii pubmed_id title subtype creator afid affilname ' 'affiliation_city affiliation_country author_count ' 'author_names author_ids author_afids coverDate ' 'coverDisplayDate publicationName issn source_id eIssn ' 'aggregationType volume issueIdentifier article_number ' 'pageRange description authkeywords citedby_count ' 'openaccess fund_acr fund_no fund_sponsor' doc = namedtuple ( 'Document' , fields ) for item in self . _json : info = { } try : info [ "affilname" ] = _join ( item [ 'affiliation' ] , 'affilname' ) info [ "afid" ] = _join ( item [ 'affiliation' ] , 'afid' ) info [ "aff_city" ] = _join ( item [ 'affiliation' ] , 'affiliation-city' ) info [ "aff_country" ] = _join ( item [ 'affiliation' ] , 'affiliation-country' ) except KeyError : pass try : authors = _deduplicate ( item [ 'author' ] ) surnames = _replace_none ( [ d [ 'surname' ] for d in authors ] ) firstnames = _replace_none ( [ d [ 'given-name' ] for d in authors ] ) info [ "auth_names" ] = ";" . join ( [ ", " . join ( [ t [ 0 ] , t [ 1 ] ] ) for t in zip ( surnames , firstnames ) ] ) info [ "auth_ids" ] = ";" . join ( [ d [ 'authid' ] for d in authors ] ) affs = [ ] for auth in authors : aff = listify ( _deduplicate ( auth . get ( 'afid' , [ ] ) ) ) affs . append ( '-' . join ( [ d [ '$' ] for d in aff ] ) ) info [ "auth_afid" ] = ( ';' . join ( affs ) or None ) except KeyError : pass date = item . get ( 'prism:coverDate' ) if isinstance ( date , list ) : date = date [ 0 ] . get ( '$' ) new = doc ( article_number = item . get ( 'article-number' ) , title = item . get ( 'dc:title' ) , fund_sponsor = item . get ( 'fund-sponsor' ) , subtype = item . get ( 'subtype' ) , issn = item . get ( 'prism:issn' ) , creator = item . get ( 'dc:creator' ) , affilname = info . get ( "affilname" ) , author_names = info . get ( "auth_names" ) , doi = item . get ( 'prism:doi' ) , coverDate = date , volume = item . get ( 'prism:volume' ) , coverDisplayDate = item . get ( 'prism:coverDisplayDate' ) , publicationName = item . get ( 'prism:publicationName' ) , 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 [ 'eid' ] , fund_acr = item . get ( 'fund-acr' ) , pubmed_id = item . get ( 'pubmed-id' ) ) out . append ( new ) return out or None
A list of namedtuples in the form (eid doi pii pubmed_id title
        subtype creator afid affilname affiliation_city affiliation_country
        author_count author_names author_ids author_afids coverDate
        coverDisplayDate publicationName issn source_id eIssn aggregationType
        volume issueIdentifier article_number pageRange description
        authkeywords citedby_count openaccess fund_acr fund_no fund_sponsor).
        Field definitions correspond to
        https://dev.elsevier.com/guides/ScopusSearchViews.htm, except for
        afid, affilname, affiliation_city, affiliation_country, author_count,
        author_names, author_ids and author_afids:  These information are
        joined on ";".  In case an author has multiple affiliations, they are
        joined on "-" (e.g. Author1Aff;Author2Aff1-Author2Aff2).

        Notes
        -----
        The list of authors and the list of affiliations per author are
        deduplicated.