How to use the pybliometrics.scopus.utils.chained_get function in pybliometrics

To help you get started, we’ve selected a few pybliometrics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pybliometrics-dev / pybliometrics / pybliometrics / scopus / abstract_retrieval.py View on Github external
def source_id(self):
        """Scopus source ID of the document."""
        return chained_get(self._json, ['coredata', 'source-id'])
github pybliometrics-dev / pybliometrics / pybliometrics / scopus / author_retrieval.py View on Github external
def given_name(self):
        """Author's preferred given name."""
        path = ['author-profile', 'preferred-name', 'given-name']
        return chained_get(self._json, path)
github pybliometrics-dev / pybliometrics / pybliometrics / scopus / author_retrieval.py View on Github external
def status(self):
        """The status of the author profile."""
        return chained_get(self._json, ["author-profile", "status"])
github pybliometrics-dev / pybliometrics / pybliometrics / scopus / abstract_retrieval.py View on Github external
def publicationName(self):
        """Name of source the document is published in."""
        return chained_get(self._json, ['coredata', 'prism:publicationName'])
github pybliometrics-dev / pybliometrics / pybliometrics / scopus / abstract_retrieval.py View on Github external
def publisher(self):
        """Name of the publisher of the document.
        Note: Information provided in the FULL view of the article might be
        more complete.
        """
        # Return information from FULL view, fall back to other views
        full = chained_get(self._head, ['source', 'publisher', 'publishername'])
        if full is None:
            return chained_get(self._json, ['coredata', 'dc:publisher'])
        else:
            return full
github pybliometrics-dev / pybliometrics / pybliometrics / scopus / abstract_retrieval.py View on Github external
def url(self):
        """URL to the API view of the document."""
        return chained_get(self._json, ['coredata', 'prism:url'])
github pybliometrics-dev / pybliometrics / pybliometrics / scopus / abstract_retrieval.py View on Github external
def authors(self):
        """A list of namedtuples representing the article's authors, in the
        form (auid, indexed_name, surname, given_name, affiliation_id,
        affiliation, city, country).
        Note: The affiliation referred to here is what Scopus' algorithm
        determined as the main affiliation.  Property `authorgroup` provides
        all affiliations.
        """
        out = []
        fields = 'auid indexed_name surname given_name affiliation'
        auth = namedtuple('Author', fields)
        for item in chained_get(self._json, ['authors', 'author'], []):
            affs = [a for a in listify(item.get('affiliation')) if a]
            if affs:
                aff = [aff.get('@id') for aff in affs]
            else:
                aff = None
            new = auth(auid=item['@auid'], surname=item.get('ce:surname'),
                indexed_name=item.get('ce:indexed-name'), affiliation=aff,
                given_name=chained_get(item, ['preferred-name', 'ce:given-name']))
            out.append(new)
        return out or None
github pybliometrics-dev / pybliometrics / pybliometrics / scopus / author_retrieval.py View on Github external
def subject_areas(self):
        """List of named tuples of subject areas in the form
        (area, abbreviation, code) of author's publication.
        """
        path = ['subject-areas', 'subject-area']
        area = namedtuple('Subjectarea', 'area abbreviation code')
        areas = [area(area=item['$'], code=item['@code'],
                      abbreviation=item['@abbrev'])
                 for item in chained_get(self._json, path, [])]
        return areas or None
github pybliometrics-dev / pybliometrics / pybliometrics / scopus / abstract_retrieval.py View on Github external
def subject_areas(self):
        """List of namedtuples containing subject areas of the article
        in the form (area abbreviation code).
        Note: Requires the FULL view of the article.
        """
        area = namedtuple('Area', 'area abbreviation code')
        path = ['subject-areas', 'subject-area']
        out = [area(area=item['$'], abbreviation=item['@abbrev'],
                    code=item['@code'])
               for item in listify(chained_get(self._json, path, []))]
        return out or None