sprynger.Metadataο
Module with Metadata class.
- class sprynger.metadata.Metadata(query: str = '', start: int = 1, nr_results: int = 10, premium: bool = False, cache: bool = True, refresh: bool | int = False, **kwargs)ο
Bases:
RetrieveClass to retreive the metadata of a document from the Springer Metadata API.
- Parameters:
query (str) β The query to search for.
start (int) β The starting index for the results. Defaults to 1.
nr_results (int) β The number of results to retrieve. Defaults to 10.
premium (bool) β Whether the user has a premium account. Defaults to False.
cache (bool) β Whether to cache the results. Defaults to True.
refresh (bool|int) β Weather to refresh the cache. If an integer is provided, it will be used as the cache expiration time in days. Defaults to False.
kwargs β Additional fields for query (e.g. issn, datefrom, dateto, etc.). For a comprehensive list of available fields, see the Springer Metadata API documentation.
This class is iterable, allowing you to iterate over the metadata records retrieved. It also supports indexing to access the metadata of specific documents.
Example
Retrieve the metadata of documents with the word βSegmentationβ from the journal with the ISSN β1573-7497β starting from the date β2024-01-01β.
>>> metadata = Metadata('Segmentation', issn='1573-7497', datefrom='2024-01-01') >>> for record in metadata: >>> print(record)
Note
The properties facets, records and results can be converted to a pandas DataFrame with pd.DataFrame(object.property).
- property facets: list[MetadataFacets]ο
Faceted information about the results.
- Returns:
A list of MetadataFacets objects containing the facet, value, and count.
- Return type:
list[MetadataFacets]
- property json: dictο
Raw JSON response from the Springer Metadata API.
- property records: list[MetadataRecord]ο
Contains the individual records that matched the query.
- Returns:
List of MetadataRecord objects which contain the following items of a document: contentType, identifier, language, url, url_format, url_platform, title, creators, publicationName, openaccess, doi, publisher, publicationDate, publicationType, issn, volume, number, genre, startingPage, endingPage, journalId, copyright, abstract and subjects.
- Return type:
list[MetadataRecord]
- property results: MetadataResultο
Overview of the results of the query.
- Returns:
An object containing the the total matches found, start index of the first result, max pageLength when paginating and the number of recordsRetrieved.
- Return type:
MetadataResult