elsapy Documentation

repository·master·Indexed 19 days ago

https://github.com/elsevierdev/elsapy

A Python module for programmatically interacting with Elsevier's publication and citation data via api.elsevier.com. It provides core classes such as ElsClient for API interaction, ElsSearch for indexing, and entity classes including AbsDoc, FullDoc, ElsAuthor, and ElsAffil to manage Scopus and ScienceDirect data.

Tokens
663
Snippets
2
Records
4
Agent score
16%

What's inside elsapy

  1. Understand the elsapy data model and core classes

    master

    The elsapy module is organized around several key classes that map to Elsevier's data model:

    • ElsClient: The primary interface for interacting with api.elsevier.com.
    • ElsSearch: Represents a search through an index (Document, Author, or Affiliation). After execution, results are stored in the .results attribute as a list of dictionaries.

    Entities (ElsEntity)

    ElsEntity is an abstract class representing an entity in the Scopus data model. Entities can be initialized with a URI and then read from the API using an ElsClient. Once read, the object's data is accessible via the .data attribute (a JSON/dictionary representation).

    Document Types

    • AbsDoc: Represents a Scopus document (abstract only), typically a scholarly article record.
    • FullDoc: Represents a ScienceDirect document (full text), such as a scholarly article or book chapter.

    Profiled Entities (elsProf)

    elsProf is an abstract class for profiled entities in Scopus, with two main descendants:

    • ElsAuthor: Represents a Scopus author.
    • ElsAffil: Represents a Scopus affiliation (institution).

    Note for Authors and Affiliations: Both ElsAuthor and ElsAffil provide a .readDocs() method. This retrieves all publications associated with that entity and stores them in a .doc_list attribute as a list of metadata dictionaries.

  2. Access and explore entity data

    master

    When an ElsEntity (such as AbsDoc, FullDoc, ElsAuthor, or ElsAffil) has been read from the API, its content is stored in the .data attribute as a Python dictionary.

    To explore the available fields, use the .data.keys() method to list the first-level keys, then drill down into the dictionary to access nested information.

    # Example of exploring entity data
    entity = ElsAuthor(uri)
    entity.read(client)
    
    # List top-level keys
    print(entity.data.keys())
    
    # Access specific data
    author_name = entity.data['author-name']