sprynger.Meta

Module with Meta class.

class sprynger.meta.Meta(query: str = '', start: int = 1, nr_results: int = 10, premium: bool = False, cache: bool = True, refresh: bool | int = False, **kwargs)

Bases: Metadata

Class to retreive the metadata of a document from the Springer Meta v2 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 that match the query β€˜Segmentation’ with ISSN β€˜1573-7497’ and starting from the date β€˜2024-01-01’.

>>> meta = Meta('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[MetaRecord]

Contains the individual records that matched the query.

Returns:

List of MetaRecord objects which contain the following items of a document: contentType, identifier, language, urls, title, creators, publicationName, openaccess, doi, publisher, publicationDate, publicationType, issn, eIssn, volume, number, issueType, topicalCollection, genre, startingPage, endingPage, journalId, onlineDate, copyright, abstract, conferenceInfo, keyword, subjects and disciplines.

Return type:

list[MetaRecord]

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