How to use the pybliometrics.scopus.classes.Retrieval 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_citations.py View on Github external
from collections import namedtuple
from datetime import datetime

from pybliometrics.scopus.classes import Retrieval


class CitationOverview(Retrieval):
    @property
    def authors(self):
        """A list of namedtuples storing author information,
        where each namedtuple corresponds to one author.
        The information in each namedtuple is (name surname initials id url).
        All entries are strings.
        """
        out = []
        order = 'name surname initials id url'
        auth = namedtuple('Author', order)
        for author in self._citeInfoMatrix.get('author'):
            author = {k.split(":", 1)[-1]: v for k, v in author.items()}
            new = auth(name=author.get('index-name'), id=author.get('authid'),
                       surname=author.get('surname'),
                       initials=author.get('initials'),
                       url=author.get('author-url'))
github pybliometrics-dev / pybliometrics / pybliometrics / scopus / abstract_retrieval.py View on Github external
from collections import namedtuple

from pybliometrics.scopus.classes import Retrieval
from pybliometrics.scopus.utils import chained_get, get_id, detect_id_type,\
    get_link, listify


class AbstractRetrieval(Retrieval):
    @property
    def abstract(self):
        """The abstract of a document.
        Note: If this is empty, try property description instead.
        """
        return self._head.get('abstracts')

    @property
    def affiliation(self):
        """A list of namedtuples representing listed affiliations in
        the form (id, name, city, country).
        Note: Might be empty.
        """
        out = []
        aff = namedtuple('Affiliation', 'id name city country')
        affs = listify(self._json.get('affiliation', []))
github pybliometrics-dev / pybliometrics / pybliometrics / scopus / author_retrieval.py View on Github external
from collections import namedtuple
from warnings import warn

from json import loads

from .author_search import AuthorSearch
from .scopus_search import ScopusSearch
from pybliometrics.scopus.classes import Retrieval
from pybliometrics.scopus.utils import chained_get, cache_file, get_link,\
    listify, parse_date_created


class AuthorRetrieval(Retrieval):
    @property
    def affiliation_current(self):
        """The ID of the current affiliation according to Scopus."""
        return self._json.get('affiliation-current', {}).get('@id')

    @property
    def affiliation_history(self):
        """Unordered list of IDs of all affiliations the author was
        affiliated with acccording to Scopus.
        """
        affs = self._json.get('affiliation-history', {}).get('affiliation')
        try:
            return [d['@id'] for d in affs]
        except TypeError:  # No affiliation history
            return None
github pybliometrics-dev / pybliometrics / pybliometrics / scopus / serial_title.py View on Github external
from collections import namedtuple

from pybliometrics.scopus.classes import Retrieval
from pybliometrics.scopus.utils import get_link


class SerialTitle(Retrieval):
    @property
    def aggregation_type(self):
        """The type of the source."""
        return self._entry['prism:aggregationType']

    @property
    def citescoreyearinfolist(self):
        """A list of two tuples of the form (year, cite-score).  The first
        tuple represents the current cite-score, the second tuple
        represents the tracker cite-score."""
        try:
            d = self._entry['citeScoreYearInfoList']
        except KeyError:
            return None
        current = (d['citeScoreCurrentMetricYear'], d['citeScoreCurrentMetric'])
        tracker = (d['citeScoreTrackerYear'], d['citeScoreTracker'])
github pybliometrics-dev / pybliometrics / pybliometrics / scopus / affiliation_retrieval.py View on Github external
from collections import namedtuple

from pybliometrics.scopus.classes import Retrieval
from pybliometrics.scopus.utils import chained_get, get_id, get_link,\
    parse_date_created


class ContentAffiliationRetrieval(Retrieval):
    @property
    def address(self):
        """The address of the affiliation."""
        return self._json.get('address')

    @property
    def affiliation_name(self):
        """The name of the affiliation."""
        return self._json.get('affiliation-name')

    @property
    def author_count(self):
        """Number of authors associated with the affiliation."""
        return self._json['coredata'].get('author-count')

    @property