pybliometrics.scopus.AuthorSearch

class pybliometrics.scopus.AuthorSearch(query, refresh=False, count=200, download=True, integrity_fields=None, integrity_action='raise', verbose=False)[source]

Interaction with the Author Search API.

Parameters:
  • query (str) – A string of the query, e.g. “authlast(Einstein) and authfirst(Albert)”.
  • refresh (bool or int (optional, default=False)) – Whether to refresh the cached file if it exists or not. If int is passed, cached file will be refreshed if the number of days since last modification exceeds that value.
  • count (int (optional, default=200)) – The number of entries to be displayed at once. A smaller number means more queries with each query having less results.
  • download (bool (optional, default=True)) – Whether to download results (if they have not been cached).
  • integrity_fields (None or iterable (default=None)) – Iterable of field names whose completeness should be checked. ScopusSearch will perform the action specified in integrity_action if elements in these fields are missing. This helps avoiding idiosynchratically missing elements that should always be present, such as the EID.
  • integrity_action (str (optional, default="raise")) – What to do in case integrity of provided fields cannot be verified. Possible actions: - “raise”: Raise an AttributeError - “warn”: Raise a UserWarning
  • verbose (bool (optional, default=False)) – Whether to print a downloading progress bar to terminal. Has no effect for download=False.
Raises:
  • ScopusQueryError – If the number of search results exceeds 5000.
  • ValueError – If the integrity_action parameter is not one of the allowed ones.

Examples

See https://pybliometrics.readthedocs.io/en/stable/examples/AuthorSearch.html.

Notes

The directory for cached results is {path}/STANDARD/{fname}, where path is specified in ~/.scopus/config.ini and fname is the md5-hashed version of query.

authors

A list of namedtuples storing author information, where each namedtuple corresponds to one author. The information in each namedtuple is (eid surname initials givenname documents affiliation affiliation_id city country areas).

All entries are strings or None. Areas combines abbreviated subject areas followed by the number of documents in this subject.

Raises:ValueError – If the elements provided in integrity_fields do not match the actual field names (listed above).
get_cache_file_age()

Return the age of the cached file in days.

get_cache_file_mdate()

Return the modification date of the cached file.

get_key_remaining_quota()

Return number of remaining requests for the current key and the current API (relative on last actual request).

get_key_reset_time()

Return time when current key is reset (relative on last actual request).

get_results_size()

Return the number of results (works even if download=False).