pybliometrics.sciencedirect.NonserialTitle¶
NonserialTitle() implements the ScienceDirect Nonserial Title API. It provides metadata for non-serial publications (books) registered in ScienceDirect, including publisher details, identifiers, and links.
Documentation¶
- class pybliometrics.sciencedirect.NonserialTitle(isbn, view='STANDARD', refresh=False, **kwds)[source]¶
Interaction with the ScienceDirect Nonserial Title API.
- Parameters:
isbn (
int|str) – The ISBN of the book.view (
str, optional) – The view of the file that should be downloaded. Allowed value: “STANDARD”. For details see the documentation. Note that although the “BASIC” view is documented, the API does not support it.Default:'STANDARD'refresh (
bool|int, optional) – 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.Default:Falsekwds (
str) – Keywords passed on as query parameters. Must contain fields and values mentioned in the API specification.- Raises:
ValueError – If any of the parameters refresh or view is not one of the allowed values.
Note
The directory for cached results is
{path}/{view}/{source_id}, where path is specified in your configuration file.- property aggregation_type: str¶
The type of the source.
- property authors: str | None¶
The authors of the book.
- property description: str | None¶
The description of the book.
- property edition: str | None¶
The edition of the book.
- property editors: str | None¶
The editors of the book.
- property isbn: str¶
The ISBN of the book.
- property link_coverimage: str¶
The link to the cover image of the book.
- property link_homepage: str¶
The link to the homepage of the book.
- property link_search: str¶
The link to search for the book.
- property publisher_id: str¶
The publisher id of the book.
- property publisher_name: str¶
The publisher of the book.
- property self_link: str¶
URL to the source’s API page.
- property title: str¶
The title of the book.
- get_cache_file_age()¶
Return the age of the cached file in days.
- Return type:
int
- get_cache_file_mdate()¶
Return the modification date of the cached file.
- Return type:
str
- get_key_remaining_quota()¶
Return number of remaining requests for the current key and the current API (relative on last actual request).
- Return type:
str | None
- get_key_reset_time()¶
Return time when current key is reset (relative on last actual request).
- Return type:
str | None
Examples¶
You initialize the class with an ISBN (with or without hyphens):
>>> from pybliometrics.sciencedirect import NonserialTitle, init >>> init() >>> book = NonserialTitle("978-0-12-823751-9")
You can obtain basic information just by accessing the properties:
>>> book.title 'The Migration Ecology of Birds' >>> book.publisher_name 'Academic Press' >>> book.isbn '9780128237519' >>> book.aggregation_type 'ebook' >>> book.authors 'Ian Newton' >>> book.edition 'Second Edition' >>> book.self_link 'https://api.elsevier.com/content/nonserial/title/isbn/9780128237519' >>> book.link_homepage 'https://www.sciencedirect.com/science/book/9780128237519' >>> book.link_coverimage 'https://api.elsevier.com/content/nonserial/title/isbn/9780128237519?view=coverimage'
Downloaded results are cached to expedite subsequent analyses. This information may become outdated. To refresh the cached results if they exist, set refresh=True, or provide an integer that will be interpreted as maximum allowed number of days since the last modification date. For example, if you want to refresh all cached results older than 100 days, set refresh=100. Use ab.get_cache_file_mdate() to obtain the date of last modification, and ab.get_cache_file_age() to determine the number of days since the last modification.