sprynger.OpenAccess

Module with the OpenAccess class to retrieve Open Access documents from Springer Nature API. Iterate or slice the OpenAccess object to get the documents. Documents can be either:

  • Articles: OpenAccess articles from journals.

  • Chapters: OpenAccess chapters from books.

The OpenAccess class enables two options for full-text retrieval:

  1. Use the full_text property to get the full text of the document in XML (JATS) format.

  2. Use the parsed_text property to get the full text of the document parsed into sections.

Example

>>> from sprynger import OpenAccess
>>> oa = OpenAccess('"Gaussian-mixture models"', datefrom='2024-01-01')
>>> # Print doi and access the full text of the document
>>> for doc in oa:
>>>     print(doc.doi)
>>>     print(doc.full_text)
>>>     print(doc.parsed_text)
class sprynger.openaccess.OpenAccess(query: str = '', start: int = 1, nr_results: int = 10, premium: bool = False, cache: bool = True, refresh: bool | int = False, **kwargs)

Bases: Retrieve

Retrieve Open Access documents from Springer Nature API.

Parameters:
  • query (str) – Query string.

  • start (int) – Start index of the results.

  • nr_results (int) – Number of results to retrieve.

  • premium (bool) – Use the premium API.

  • cache (bool) – Use the cache.

  • refresh (Union[bool, int]) – Refresh the cache.

  • **kwargs – Additional fields for query (e.g. issn, datefrom, dateto, etc.). For a comprehensive list of available fields, see the Springer Metadata API documentation.

Example

Retrieve Open Access articles from the journal with ISSN ‘2223-7704’ published after ‘2024-01-01’.

>>> oa = OpenAccess(issn=2223-7704, datefrom='2024-01-01')
property documents_found: int

Number of documents found.

property xml: str

Raw XML response from the Open Access API.

class sprynger.openaccess.Article(data)

Auxiliary class to parse an article from a journal.

property abstract: str | None

Abstract of the article.

property acknowledgements: str | None

Acknowledgements of the article.

property affiliations: list[Affiliation]

List of affiliations of the collaborators of the article. Each affiliation is represented as a named tuple with the following fields: type, ref_nr, ror, grid, isni, division, name, city, country.

Note: To match affiliations with contributors use the affiliation’s ref_nr and the contributor’s affiliations_ref_nr.

property article_type: str | None

Type of the article.

property contributors: list[Contributor]

List of contributors of the article. Each contributor is represented as a named tuple with the following fields: type, nr, orcid, surname, given_name, email, affiliations_ref_nr.

Note: To match contributors with affiliations use the contributor’s affiliations_ref_nr and the affiliation’s ref_nr.

property date_accepted: Date

Accepted date of the article.

property date_epub: Date

Electronic publication date of the article.

property date_online: Date

Online date of the article.

property date_ppub: Date

Print publication date of the article.

property date_received: Date

Date when article was recieved.

property date_registration: Date

Registration date of the article.

property doi: str | None

DOI of the article.

property full_text: str | None

Raw full text of the article in JATS format.

property issn_electronic: str | None

Electronic ISSN of the journal.

property issn_print: str | None

Print ISSN of the journal.

property journal_abbrev_title: str | None

Abbreviated title of the journal.

property journal_doi: str | None

DOI of the journal.

property journal_publisher_id: str | None

Publisher ID of the journal.

property journal_title: str | None

Title of the journal.

property language: str | None

Language of the article.

property manuscript: str | None

Manuscript of the article.

property parsed_text: list[Section]

Parsed article’s text divided into sections.

Returns:

A list of Section objects containing the section_id, section_title, and text.

Return type:

list[Section]

property publisher_id: str | None

Publisher ID of the article.

property publisher_loc: str | None

Location of the publisher.

property publisher_name: str | None

Name of the publisher.

property references: list[Reference]

References of the article.

Returns:

A list of Reference objects containing the ref_list_id, ref_list_title, ref_id, ref_label, ref_publication_type, authors, editors, names, ref_title, ref_source, ref_year, ref_doi.

Return type:

list[Reference]

property title: str | None

Title of the article.

class sprynger.openaccess.Chapter(data)

Auxiliary class to parse a chapter from a book.

property abstract: str | None

Abstract of the chapter.

property acknowledgements: str | None

Acknowledgements of the chapter.

property affiliations: list[Affiliation]

List of affiliations of the collaborators of the chapter. Each affiliation is represented as a named tuple with the following fields: type, ref_nr, ror, grid, isni, division, name, city, country.

Note: To match affiliations with contributors use the affiliation’s ref_nr and the contributor’s affiliations_ref_nr.

property book_doi: str | None

DOI of the book.

property book_pub_date: str | None

Publication date of the book.

property book_sub_title: str | None

Sub-title of the book.

property book_title: str | None

Title of the book.

property book_title_id: str | None

Book title ID.

property chapter_nr: str | int | None

Book chapter name or number.

property contributors: list[Contributor]

List of contributors of the chapter. Each contributor is represented as a named tuple with the following fields: type, nr, orcid, surname, given_name, email, affiliations_ref_nr.

Note: To match contributors with affiliations use the contributor’s affiliations_ref_nr and the affiliation’s ref_nr.

property date_epub: Date

Electronic publication date of the chapter.

property date_online: Date

Online date of the chapter.

property date_ppub: Date

Print publication date of the chapter.

property date_registration: Date

Registration date of the chapter.

property doi: str | None

DOI of the chapter.

property full_text: str | None

Raw full text of the chapter in JATS format.

property isbn_electronic: str | None

ISBN of the electronic version of the book.

property isbn_print: str | None

ISBN of the print version of the book.

property parsed_text: list[Section]

Parsed chapter’s text divided into sections.

Returns:

A list of Section objects containing the section_id, section_title, and text.

Return type:

list[Section]

property publisher_id: str | None

Publisher ID of the chapter’s book.

property publisher_loc: str | None

Location of the publisher.

property publisher_name: str | None

Name of the publisher.

property references: list[Reference]

References of the chapter.

Returns:

A list of Reference objects containing the ref_list_id, ref_list_title, ref_id, ref_label, ref_publication_type, authors, editors, names, ref_title, ref_source, ref_year, ref_doi.

Return type:

list[Reference]

property title: str | None

Title of the chapter.