### Install Development Version Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/installation.md Install the development version directly from the GitHub repository. This requires Git to be installed on your system. ```bash pip install git+https://github.com/pybliometrics-dev/pybliometrics ``` -------------------------------- ### Set Up Virtual Environment and Install Pybliometrics Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/contributing.md Install your local copy of Pybliometrics in a virtual environment for development. This ensures dependencies are managed correctly. ```default mkvirtualenv pybliometrics cd pybliometrics/ pip install -e . ``` -------------------------------- ### Install Stable Version Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/installation.md Use this command to install the latest stable release of pybliometrics from the Python Package Index (PyPI). ```bash pip install pybliometrics ``` -------------------------------- ### Install Pybliometrics Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/CONTRIBUTING.rst Upgrade to the newest version of pybliometrics using pip. ```bash pip install pybliometrics --upgrade ``` -------------------------------- ### Interactive Configuration Prompts Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/configuration.md Example of the interactive prompts when creating a new pybliometrics.cfg file. You will be asked for API keys and optionally InstTokens. ```none Creating config file at C:\Users\rosm\.config\pybliometrics.cfg with default paths... Please enter your API Key(s), obtained from http://dev.elsevier.com/myapikey.html. Separate multiple keys by comma: xxx API Keys are sufficient for most users. If you have an InstToken, please enter the tokens pair now. Separate multiple tokens by a comma. The correspondig key's position should match the position of the token.If you don't have tokens, just press Enter: yyy ``` -------------------------------- ### Pybliometrics Configuration File Structure Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/configuration.md This is an example of the pybliometrics.cfg file structure, showing default settings for directories, authentication, proxy, and requests. Edit this file manually to customize paths and credentials. ```none [Directories] AbstractRetrieval = PPP/.cache/pybliometrics/Scopus/abstract_retrieval AffiliationRetrieval = PPP/.cache/.pybliometrics/Scopus/affiliation_retrieval AffiliationSearch = PPP/.cache/.pybliometrics/Scopus/affiliation_search AuthorRetrieval = PPP/.cache/.pybliometrics/Scopus/author_retrieval AuthorSearch = PPP/.cache/.pybliometrics/Scopus/author_search CitationOverview = PPP/.cache/.pybliometrics/Scopus/citation_overview ScopusSearch = PPP/.cache/.pybliometrics/Scopus/scopus_search SerialTitleSearch = PPP/.cache/.pybliometrics/Scopus/serial_search SerialTitleISSN = PPP/.cache/.pybliometrics/Scopus/serial_title PlumXMetrics = PPP/.cache/.pybliometrics/Scopus/plumx SubjectClassifications = PPP/.cache/.pybliometrics/Scopus/subject_classification [Authentication] APIKey = Key1, Key2, Key3 InstToken = Token for Key1, Token for Key2, Token for Key3 [Proxy] http = http://127.0.0.1:1234 https = https://127.0.0.1:1234 [Requests] Timeout = 20 Retries = 5 ``` -------------------------------- ### Scopus Abstract and Author Retrieval Example Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/README.rst Demonstrates retrieving abstract details, publication name, authors, and author H-index using Scopus API. Requires API keys to be initialized. ```python >>> import pybliometrics >>> pybliometrics.init() # read API keys >>> # Document-specific information >>> from pybliometrics.scopus import AbstractRetrieval >>> ab = AbstractRetrieval("10.1016/j.softx.2019.100263") >>> ab.title 'pybliometrics: Scriptable bibliometrics using a Python interface to Scopus' >>> ab.publicationName 'SoftwareX' >>> ab.authors [Author(auid=57209617104, indexed_name='Rose M.E.', surname='Rose', given_name='Michael E.', affiliation='60105007'), Author(auid=7004212771, indexed_name='Kitchin J.R.', surname='Kitchin', given_name='John R.', affiliation='60027950')] >>> >>> # Author-specific information >>> from pybliometrics.scopus import AuthorRetrieval >>> au2 = AuthorRetrieval(ab.authors[1].auid) >>> au2.h_index 34 >>> au1 = AuthorRetrieval(ab.authors[0].auid) >>> au1.affiliation_current [Affiliation(id=60105007, parent=None, type='parent', relationship='author', afdispname=None, preferred_name='Max Planck Institute for Innovation and Competition', parent_preferred_name=None, country_code='deu', country='Germany', address_part='Marstallplatz 1', city='Munich', state='Bayern', postal_code='80539', org_domain='ip.mpg.de', org_URL='http://www.ip.mpg.de/')] >>> >>> # Affiliation information >>> from pybliometrics.scopus import AffiliationRetrieval >>> aff1 = AffiliationRetrieval(au1.affiliation_current[0].id) >>> aff1.author_count 98 ``` -------------------------------- ### Get Default Configuration File Path Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/configuration.md Use this snippet to print the path of the configuration file your current pybliometrics instance is using. This helps in locating or verifying the configuration file. ```python >>> import pybliometrics >>> print(pybliometrics.utils.constants.CONFIG_FILE) ``` -------------------------------- ### Get Number of Results Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/ScopusSearch.md Demonstrates how to programmatically determine the total number of results for a search query using the get_results_size() method. This is useful for subscribers to decide whether to proceed with downloading. ```python >>> s.get_results_size() 128 ``` ```python >>> other = ScopusSearch('AUTHLASTNAME(Brown)', download=False) >>> other.get_results_size() 316970 ``` -------------------------------- ### Convert Object Metadata to Pandas DataFrame Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/sciencedirect/ObjectMetadata.md Convert the retrieved object metadata results into a pandas DataFrame for easier analysis. This example shows how to inspect columns and the DataFrame's shape. ```python >>> df = pd.DataFrame(om.results) >>> # Print retrieved fields >>> df.columns Index(['eid', 'filename', 'height', 'mimetype', 'ref', 'size', 'type', 'url', 'width'], dtype='object') >>> # Get shape of the dataframe (rows x columns) >>> df.shape (355, 9) >>> # Print the first 5 rows >>> df.head() ``` -------------------------------- ### Retrieve Affiliation History Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AuthorRetrieval.md Retrieves the historical affiliations of the author. The example shows how to get the length of the history and access a specific historical affiliation entry. ```python >>> len(au.affiliation_history) 16 >>> au.affiliation_history[6] Affiliation(id=60008644, parent=None, type='parent', relationship='author', afdispname=None, preferred_name='Fritz Haber Institute of the Max Planck Society', parent_preferred_name=None, country_code='deu', country='Germany', address_part='Faradayweg 4-6', city='Berlin', state=None, postal_code='14195', org_domain='fhi.mpg.de', org_URL='https://www.fhi.mpg.de/') ``` -------------------------------- ### ScopusSearch Initialization and Usage Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/ScopusSearch.md Demonstrates how to initialize the ScopusSearch class with a query and retrieve search results. The `verbose` parameter shows download progress. ```APIDOC ## ScopusSearch Initialization and Usage ### Description Initializes the ScopusSearch class with a given query and optionally displays download progress. The search query follows Scopus Advanced Document Search syntax, with exceptions for `LIMIT-TO()` and `INDEXTERMS()`. ### Method `ScopusSearch(query: str, verbose: bool = False)` ### Parameters - **query** (str) - Required - The search query string. - **verbose** (bool) - Optional - If True, displays download progress. ### Request Example ```python >>> import pyblimetrics >>> from pybliometrics.scopus import ScopusSearch >>> pybliometrics.scopus.init() >>> q = "REF(2-s2.0-85068268027)" >>> s = ScopusSearch(q, verbose=True) Downloading results for query "REF(2-s2.0-85068268027)": 100%|████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:05<00:00, 1.07s/it] ``` ### Response - **s** (ScopusSearch object) - The initialized ScopusSearch object containing the search results. ``` -------------------------------- ### Initialize Pybliometrics Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/configuration.md Import and initialize Pybliometrics to load configuration from default locations. If the config file doesn't exist, this will prompt for API keys and InstTokens. ```python >>> import pybliometrics >>> pybliometrics.init() ``` -------------------------------- ### Retrieving Citation Count Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AbstractRetrieval.md Demonstrates how to get the total citation count for an article. ```APIDOC ## Retrieving Citation Count ### Description Obtains the total number of times the article has been cited, as recorded at the time the abstract was retrieved and cached. ### Attribute * **citedby_count**: The total citation count. ### Example ```python print(ab.citedby_count) ``` ``` -------------------------------- ### Initialize and Search ScienceDirect Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/sciencedirect/ScienceDirectSearch.md Initialize the pybliometrics library and perform a search on ScienceDirect. Set verbose=True to observe download progress. ```python from pybliometrics.sciencedirect import ScienceDirectSearch, init init() # Retrieve documents based on the search query sds = ScienceDirectSearch('"neural radiance fields" AND "3D" AND YEAR(2024)', verbose=True) ``` -------------------------------- ### Get SerialTitleSearch Results Size Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/SerialTitleSearch.md Obtains the number of results programmatically using the .get_results_size() method. ```python >>> s.get_results_size() 1 ``` -------------------------------- ### Initialize pybliometrics with custom configuration directory and API keys Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/tips.md Use this function to initialize pybliometrics, specifying a custom configuration directory and providing a list of API keys. This offers more flexibility in managing configuration files and API access. ```python import pybliometrics >>> pybliometrics.scopus.init() ``` -------------------------------- ### Get Total Citation Count Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AbstractRetrieval.md Retrieve the total citation count for the abstract as of the time it was retrieved and cached. ```python ab.citedby_count ``` -------------------------------- ### ScopusSearch Initialization and Usage Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/ScopusSearch.md Demonstrates how to initialize the ScopusSearch class with a query and optional parameters like integrity_fields and integrity_action. It also shows how to retrieve EIDs from the search results. ```APIDOC ## ScopusSearch ### Description Initializes a search query to the Scopus database. Supports various parameters for refining searches, managing data integrity, and controlling caching behavior. ### Method `ScopusSearch(query, view='COMPLETE', cache_path=None, refresh=False, integrity_fields=None, integrity_action='raise')` ### Parameters #### Query Parameters - **query** (string) - Required - The search query string. - **view** (string) - Optional - The search view to use (e.g., 'COMPLETE', 'STANDARD'). Defaults to 'COMPLETE'. - **cache_path** (string) - Optional - Path to the cache file. - **refresh** (boolean or integer) - Optional - If True, refreshes cached results. If an integer, it specifies the maximum allowed days since the last modification date to refresh. - **integrity_fields** (iterable) - Optional - Fields to check for integrity. - **integrity_action** (string) - Optional - Action to take if integrity check fails ('warn' or 'raise'). Defaults to 'raise'. ### Method Examples #### Get EIDs ```python >>> s = ScopusSearch(q, integrity_fields=["eid"], integrity_action="warn") >>> s.get_eids() ['2-s2.0-85184035025', '2-s2.0-85187781098', ...] ``` #### Robust Query Function ```python def robust_query(q, refresh=False, fields=["eid"]): """Wrapper function for individual ScopusSearch query.""" try: return ScopusSearch(q, refresh=refresh, integrity_fields=fields).results except AttributeError: return ScopusSearch(q, refresh=True, integrity_fields=fields).results ``` ### Response #### Success Response - **results** (list) - A list of search result objects. - **get_eids()** (list) - Returns a list of EIDs from the search results. ``` -------------------------------- ### Get Citation Count Metric Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scival/AuthorMetrics.md Retrieve the CitationCount metric for an author. The result is a list of MetricData namedtuples. ```python author_metrics.CitationCount ``` -------------------------------- ### Get Cache File Information Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/sciencedirect/NonserialTitle.md Obtain the modification date and age of the cached file for a given book. ```python print(book.get_cache_file_mdate()) print(book.get_cache_file_age()) ``` -------------------------------- ### pybliometrics.utils.init Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference.md Initializes the pybliometrics library with optional configuration parameters. This function sets up the library for use by specifying API keys, institutional tokens, or configuration file paths. ```APIDOC ## pybliometrics.utils.init ### Description Initializes the pybliometrics library with optional configuration parameters. This function sets up the library for use by specifying API keys, institutional tokens, or configuration file paths. ### Method `init` ### Parameters #### Path Parameters - **config_path** (optional) - Path to the configuration file. If None, defaults to pybliometrics.utils.constants.CONFIG_FILE. - **keys** (optional) - List of API keys. - **inst_tokens** (optional) - List of corresponding InstTokens. The order must match that of keys to avoid errors. - **config_dir** (optional, Deprecated) - Path to the configuration file. Use config_path instead. ### Raises - **NoSectionError** - If the required sections (Directories, Authentication, Request) do not exist. - **ValueError** - If there are no or fewer API keys than InstTokens present. ``` -------------------------------- ### Get Author Documents Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AuthorRetrieval.md Retrieves a list of documents authored by a specific author, displaying their shape and columns. Information is cached. ```python >>> docs = pd.DataFrame(au.get_documents(refresh=10)) >>> docs.shape (126, 36) >>> docs.columns Index(['eid', 'doi', 'pii', 'pubmed_id', 'title', 'subtype', 'subtypeDescription', 'creator', 'afid', 'affilname', 'affiliation_city', 'affiliation_country', 'author_count', 'author_names', 'author_ids', 'author_afids', 'coverDate', 'coverDisplayDate', 'publicationName', 'issn', 'source_id', 'eIssn', 'aggregationType', 'volume', 'issueIdentifier', 'article_number', 'pageRange', 'description', 'authkeywords', 'citedby_count', 'openaccess', 'fund_acr', 'fund_no', 'fund_sponsor'], dtype='object') ``` -------------------------------- ### Get H-Indices Metric Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scival/AuthorMetrics.md Retrieve the HIndices metric for an author when by_year is set to False. The result is a list of MetricData namedtuples. ```python author_metrics.HIndices ``` -------------------------------- ### Initialize SubjectClassifications with a Query Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/SubjectClassifications.md Initialize the SubjectClassifications class with a dictionary specifying search criteria like 'description'. Ensure pybliometrics is initialized first. ```python >>> import pybliometrics >>> from pybliometrics.scopus import SubjectClassifications >>> pybliometrics.scopus.init() >>> sub = SubjectClassifications({'description': 'Mathematics'}) ``` -------------------------------- ### Getting RIS Citation Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AbstractRetrieval.md Shows how to retrieve a RIS formatted citation for a Scopus abstract, commonly used for reference management software. ```python >>> print(ab.get_ris()) ``` -------------------------------- ### Retrieve Author Group Information Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AbstractRetrieval.md Get detailed author group information, which includes affiliation details, organization, and other author-specific data. ```python ab.authorgroup ``` -------------------------------- ### Initialize AuthorMetrics for Multiple Authors Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scival/AuthorMetrics.md Instantiate AuthorMetrics for multiple author IDs, with an option to retrieve metrics broken down by year. This is useful for comparative analysis across authors. ```python multi_authors = AuthorMetrics([57209617104, 7004212771], by_year=True) print(multi_authors) # Create a DataFrame from the Collaboration metrics df_multi = pd.DataFrame(multi_authors.Collaboration) df_multi.head() ``` -------------------------------- ### Get Author Co-authors Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AuthorRetrieval.md Retrieves a list of co-authors for a given author and displays their shape and columns. This query is not cached and is always up-to-date. ```python >>> coauthors = pd.DataFrame(au.get_coauthors()) >>> coauthors.shape (160, 8) >>> coauthors.columns Index(['surname', 'given_name', 'id', 'areas', 'affiliation_id', 'name', 'city', 'country'], dtype='object') ``` -------------------------------- ### AbstractRetrieval Initialization and Basic Usage Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AbstractRetrieval.md Demonstrates how to initialize the AbstractRetrieval class with a document ID and retrieve basic publication information. ```APIDOC ## AbstractRetrieval Initialization and Basic Usage ### Description Initializes the `AbstractRetrieval` class with a Scopus document ID (EID) and demonstrates how to print the object to get a summary of the publication. ### Method ```python from pybliometrics.scopus import AbstractRetrieval ab = AbstractRetrieval("2-s2.0-85068268027", view='FULL') print(ab) ``` ### Parameters * **document_id** (string) - Required - The Scopus EID of the document. * **view** (string) - Optional - Specifies the level of detail to retrieve. 'FULL' retrieves all available information. ``` -------------------------------- ### Get all object filenames for a document Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/sciencedirect/ObjectRetrieval.md Use ObjectMetadata to retrieve a list of all available objects and their corresponding filenames for a given document identifier. ```python from PIL import Image from pybliometrics.sciencedirect import init, ObjectMetadata, ObjectRetrieval init() # Get all objects and its filenames om = ObjectMetadata('10.1016/j.rcim.2020.102086') all_filenames = [f.filename for f in om.results] all_filenames ``` -------------------------------- ### AbstractRetrieval Initialization and Basic Usage Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AbstractRetrieval.md Demonstrates how to initialize the AbstractRetrieval class with an article's ID and access basic metadata. It also shows how to create an 'eid' field for Scopus IDs. ```APIDOC ## AbstractRetrieval Initialization and Basic Usage ### Description Initializes the `AbstractRetrieval` class with a Scopus ID and demonstrates accessing basic article metadata. It also shows how to construct a Scopus 'eid' from an 'id'. ### Method `AbstractRetrieval(identifier, view='FULL', refresh=False)` ### Parameters #### Path Parameters None #### Query Parameters - **identifier** (str) - Required - The unique identifier for the article (e.g., '2-s2.0-85068268027'). - **view** (str) - Optional - Specifies the view of the data to retrieve. Defaults to 'FULL'. Other options include 'REF'. - **refresh** (bool or int) - Optional - Controls caching. If `False`, uses cached data. If `True`, refreshes cache. If an integer, refreshes cache if older than the specified number of days. ### Request Example ```python ab = AbstractRetrieval("2-s2.0-85068268027") print(ab.title) ``` ### Response #### Success Response (200) Returns an `AbstractRetrieval` object with attributes like `title`, `authors`, `publicationyear`, etc. #### Response Example ```python # Example of accessing attributes print(ab.title) print(ab.authors) print(ab.publicationyear) ``` ### Constructing EID ```python # Example of constructing 'eid' from 'id' df['eid'] = '2-s2.0-' + df['id'] eids = df['eid'].tolist() ``` ``` -------------------------------- ### Access SubjectClassifications Results Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/SubjectClassifications.md Access the 'results' attribute of a SubjectClassifications object to get a list of namedtuples containing detailed information about each subject area. ```python >>> sub.results [Subject(code='2600', description='Mathematics', detail='Mathematics (all)', abbrev='MATH'), Subject(code='2601', description='Mathematics', detail='Mathematics (miscellaneous)', abbrev='MATH'), Subject(code='2602', description='Mathematics', detail='Algebra and Number Theory', abbrev='MATH'), Subject(code='2603', description='Mathematics', detail='Analysis', abbrev='MATH'), Subject(code='2604', description='Mathematics', detail='Applied Mathematics', abbrev='MATH'), Subject(code='2605', description='Mathematics', detail='Computational Mathematics', abbrev='MATH'), Subject(code='2606', description='Mathematics', detail='Control and Optimization', abbrev='MATH'), Subject(code='2607', description='Mathematics', detail='Discrete Mathematics and Combinatorics', abbrev='MATH'), Subject(code='2608', description='Mathematics', detail='Geometry and Topology', abbrev='MATH'), Subject(code='2609', description='Mathematics', detail='Logic', abbrev='MATH'), Subject(code='2610', description='Mathematics', detail='Mathematical Physics', abbrev='MATH'), Subject(code='2611', description='Mathematics', detail='Modeling and Simulation', abbrev='MATH'), Subject(code='2612', description='Mathematics', detail='Numerical Analysis', abbrev='MATH'), Subject(code='2613', description='Mathematics', detail='Statistics and Probability', abbrev='MATH'), Subject(code='2614', description='Mathematics', detail='Theoretical Computer Science', abbrev='MATH')] ``` -------------------------------- ### Clone Pybliometrics Repository Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/contributing.md Clone your forked repository locally to begin development. ```default git clone https://github.com/your_username_here/pybliometrics.git ``` -------------------------------- ### Get Affiliation Search Results Size Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AffiliationSearch.md Determines the number of search results without downloading them. Useful for estimating the size of the dataset before full retrieval. ```python >>> query = "AFFIL(Max Planck Institute)" >>> s = AffiliationSearch(query, download=False) >>> s.get_results_size() 537 ``` -------------------------------- ### Initialize PlumXMetrics Object Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/PlumXMetrics.md Initialize the PlumXMetrics class with a document identifier and its type. Ensure pybliometrics is initialized first. ```python import pyblimetrics from pybliometrics.scopus import PlumXMetrics pybliometrics.scopus.init() plum = PlumXMetrics("2-s2.0-85054706190", id_type='elsevierId') ``` -------------------------------- ### Initialize ScopusSearch and Perform Search Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/ScopusSearch.md Initializes the pybliometrics library and creates a ScopusSearch object with a given query. Use verbose=True to see download progress. The query format is similar to Scopus Advanced Document Search. ```python >>> import pybliometrics >>> from pybliometrics.scopus import ScopusSearch >>> pybliometrics.scopus.init() >>> q = "REF(2-s2.0-85068268027)" >>> s = ScopusSearch(q, verbose=True) Downloading results for query "REF(2-s2.0-85068268027)": 100%|████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:05<00:00, 1.07s/it] ``` -------------------------------- ### Convert multiple topics' ScholarlyOutput to a pandas DataFrame Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scival/TopicLookupMetrics.md Convert the ScholarlyOutput property of a multi-topic TopicLookupMetrics object into a pandas DataFrame for analysis. Requires pandas to be installed. ```python >>> df = pd.DataFrame(multi_topics.ScholarlyOutput) >>> df.head() ``` -------------------------------- ### Initialize and Search Article Metadata Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/sciencedirect/ArticleMetadata.md Initializes the ScienceDirect API and creates an ArticleMetadata object with a specific search query. Ensure the API is initialized before use. ```python >>> import pandas as pd >>> from pybliometrics.sciencedirect import ArticleMetadata, init >>> init() >>> am = ArticleMetadata('TITLE("Bayesian Network") AND YEAR(2015)') ``` -------------------------------- ### Retrieve and Display Authors with Pandas Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scival/PublicationLookup.md Retrieve authors as a list of namedtuples and display them using a pandas DataFrame for convenient analysis. Ensure pandas is installed and imported. ```python >>> pub.authors [Author(id=7404861905, name='Lin, T.-E.', uri='Author/7404861905'), Author(id=24537666700, name='Lu, Y.-J.', uri='Author/24537666700'), Author(id=7404248170, name='Sun, C.-L.', uri='Author/7404248170'), Author(id=7004202515, name='Pick, H.', uri='Author/7004202515'), Author(id=58307174900, name='Chen, J.-P.', uri='Author/58307174900'), Author(id=36246291500, name='Lesch, A.', uri='Author/36246291500'), Author(id=7102360867, name='Girault, H.H.', uri='Author/7102360867')] >>> import pandas as pd >>> print(pd.DataFrame(pub.authors)) id name uri 0 7404861905 Lin, T.-E. Author/7404861905 1 24537666700 Lu, Y.-J. Author/24537666700 2 7404248170 Sun, C.-L. Author/7404248170 3 7004202515 Pick, H. Author/7004202515 4 58307174900 Chen, J.-P. Author/58307174900 5 36246291500 Lesch, A. Author/36246291500 6 7102360867 Girault, H.H. Author/7102360867 ``` -------------------------------- ### Initialize Pybliometrics Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/tips/migration3.md Use this snippet to initialize pybliometrics in version 4.x. It replaces the previous method of setting environment variables for configuration paths. ```python import pybliometrics pybliometrics.scopus.init() ``` -------------------------------- ### Getting BibTeX Citation Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AbstractRetrieval.md Demonstrates how to obtain a BibTeX formatted citation for a Scopus abstract. The key is generated from the first author's surname, year, and title. ```python >>> print(ab.get_bibtex()) ``` -------------------------------- ### PublicationLookup Initialization and Basic Usage Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scival/PublicationLookup.md Demonstrates how to initialize the PublicationLookup class with a Scopus ID and print basic publication information. ```APIDOC ## PublicationLookup Initialization and Basic Usage ### Description Initialize the `PublicationLookup` class with a Scopus ID (integer or string) and print basic publication details. ### Method ```python from pybliometrics.scival import PublicationLookup # Initialize the class with a Scopus ID pub = PublicationLookup('85036568406') # Print basic information about the publication print(pub) ``` ### Attributes - **id** (int): The Scopus ID of the publication. - **title** (str): The title of the publication. - **doi** (str): The Digital Object Identifier (DOI) of the publication. - **publication_year** (int): The year the publication was published. - **type** (str): The type of publication (e.g., 'Article'). - **citation_count** (int): The number of citations the publication has received. - **source_title** (str): The title of the source where the publication appeared. - **topic_id** (int): The topic ID associated with the publication. - **topic_cluster_id** (int): The topic cluster ID associated with the publication. - **sdgs** (list[str]): A list of Sustainable Development Goals associated with the publication. - **authors** (list[Author]): A list of Author namedtuples, each containing author ID, name, and URI. - **institutions** (list[Institution]): A list of Institution namedtuples, each containing institution ID, name, country, and country code. ``` -------------------------------- ### Concatenate MetricData into a pandas DataFrame Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scival/TopicLookupMetrics.md Combine metrics like CitationCount and ScholarlyOutput into a single list and then convert it into a pandas DataFrame for easier analysis. Requires pandas to be installed. ```python >>> import pandas as pd >>> >>> data = [] >>> data.extend(topics_metrics.CitationCount) >>> data.extend(topics_metrics.ScholarlyOutput) >>> df = pd.DataFrame(data) >>> df.head() ``` -------------------------------- ### Commit and Push Changes Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/contributing.md Stage, commit, and push your local changes to your GitHub fork. Ensure your commit message is descriptive. ```default git add . git commit -m "Your detailed description of your changes." git push origin name-of-your-bugfix-or-feature ``` -------------------------------- ### Get AuthorSearch Results Size Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AuthorSearch.md Retrieves the total number of results for an author search without downloading the full results. Set download=False during initialization if only the size is needed. ```python >>> other = AuthorSearch("AUTHLAST(Selten)", download=False) >>> other.get_results_size() 30 ``` -------------------------------- ### Retrieve Affiliation Name Variants Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AffiliationRetrieval.md Get a list of namedtuples representing different names used for the affiliation by authors. Each variant includes the name and its associated document count. ```python >>> aff.name_variants [Variant(name='University Of Cape Town', doc_count=85821), Variant(name='Univ. Cape Town', doc_count=1622), Variant(name='Univ Of Cape Town', doc_count=729), Variant(name='Institute Of Infectious Disease And Molecular Medicine', doc_count=608), Variant(name='Department Of Molecular And Cell Biology', doc_count=596)] ``` -------------------------------- ### Initialize and Search Affiliations Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AffiliationSearch.md Initializes the Scopus API and performs an affiliation search using a query string. Ensure pybliometrics.scopus.init() is called before creating the search object. ```python >>> import pybliometrics >>> from pybliometrics.scopus import AffiliationSearch >>> pybliometrics.scopus.init() >>> query = "AFFIL(Max Planck Institute for Innovation and Competition Munich)" >>> s = AffiliationSearch(query) ``` -------------------------------- ### Initialize TopicLookupMetrics with multiple SciVal Topic IDs and by_year=True Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scival/TopicLookupMetrics.md Initialize the TopicLookupMetrics class with a list of SciVal Topic IDs and set by_year=True to retrieve year-specific metrics. Ensure pybliometrics is initialized. ```python >>> multi_topics = TopicLookupMetrics(["9350", "11084"], by_year=True) >>> print(multi_topics) TopicLookupMetrics for 2 topic(s): - Molecular Catalysts for Hydrogen Production Advances (ID: 9350) - Machine Learning Potentials in Molecular Simulations (ID: 11084) ``` -------------------------------- ### Detailed CiteScore Breakdown with Pandas Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/sciencedirect/SerialTitleISSN.md Retrieves a detailed CiteScore breakdown for a given ISSN using the 'CITESCORE' view and displays it as a Pandas DataFrame. Requires the pandas library to be installed. ```python >>> import pandas as pd >>> source_full = SerialTitleISSN("00368075", view="CITESCORE") >>> info = pd.DataFrame(source_full.citescoreyearinfolist) >>> print(info) ``` -------------------------------- ### Accessing Funding, Chemicals, and Genome Banks Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AbstractRetrieval.md Illustrates how to retrieve funding information, chemical data, and sequence bank details associated with a Scopus abstract using the 'FULL' view. ```python >>> ab_fund = AbstractRetrieval("2-s2.0-85053478849", view="FULL") >>> ab_fund.funding >>> ab_fund.funding_text >>> ab_fund.chemicals >>> ab_fund.sequencebank ``` -------------------------------- ### Initialize ObjectMetadata Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/sciencedirect/ObjectMetadata.md Initialize the ObjectMetadata class with a valid document identifier. Ensure pybliometrics.sciencedirect.init() is called first. ```python >>> import pandas as pd >>> from pybliometrics.sciencedirect import ObjectMetadata, init >>> init() >>> om = ObjectMetadata('10.1016/j.neunet.2024.106632') ``` -------------------------------- ### Initialize InstitutionLookupMetrics Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scival/InstitutionLookupMetrics.md Initialize the InstitutionLookupMetrics class with one or more SciVal Institution IDs. The ID can be provided as a single ID, a list of IDs, or a comma-separated string. ```python from pybliometrics.scival import InstitutionLookupMetrics, init init() institution_metrics = InstitutionLookupMetrics("309021") ``` -------------------------------- ### Initialize AbstractRetrieval Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/AbstractRetrieval.md Initialize the AbstractRetrieval class with a Scopus EID and retrieve full abstract details. Ensure pybliometrics is initialized. ```python import pybliometrics from pybliometrics.scopus import AbstractRetrieval pybliometrics.scopus.init() ab = AbstractRetrieval("2-s2.0-85068268027", view='FULL') ``` -------------------------------- ### Run Tests on Windows Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/pybliometrics/scopus/tests/README.md On Windows, use 'python -m' before pytest commands to ensure correct execution of tests. ```bash python -m pytest --verbose ``` ```bash python -m pytest pybliometrics/scopus/tests/test_AffiliationRetrieval.py --verbose ``` -------------------------------- ### Get Detailed CiteScore Information Source: https://github.com/pybliometrics-dev/pybliometrics/blob/master/docs/reference/scopus/SerialTitleISSN.md Initialize SerialTitleISSN with view="CITESCORE" to retrieve detailed CiteScore information for all available years. This data can be converted to a pandas DataFrame for easier analysis. ```python import pandas as pd source_full = SerialTitleISSN("00368075", view="CITESCORE") info = pd.DataFrame(source_full.citescoreyearinfolist) print(info) ```