aoptk.literature.databases.ncbi =============================== .. py:module:: aoptk.literature.databases.ncbi Classes ------- .. autoapisummary:: aoptk.literature.databases.ncbi.NCBI Module Contents --------------- .. py:class:: NCBI(database: Literal['pmc', 'pubmed']) Bases: :py:obj:`aoptk.literature.get_id.GetID` Helper class to retrieve data from NCBI databases - PubMed and PMC. .. py:attribute:: max_ncbi_results :value: 9998 .. py:attribute:: max_concurrency :value: 2 .. py:attribute:: max_requests_per_second :value: 2 .. py:attribute:: minimal_year_publication :value: 1940 .. py:attribute:: datetype :value: 'pdat' .. py:attribute:: batch_size :value: 200 .. py:attribute:: async_retries :value: 10 .. py:attribute:: database .. py:attribute:: semaphore .. py:attribute:: limiter .. py:method:: get_ids(search_term: str) -> list[aoptk.literature.id.ID] Retrieve a list of publication IDs based on the search term. .. py:method:: get_abstract_records(ids: list[aoptk.literature.id.ID]) -> list[dict] Retrieve abstract records based on the list of IDs. Note: There is still the 10 000 records limit. :param ids: A list of publication IDs for which to retrieve abstracts. :type ids: list[ID] .. py:method:: get_publications_metadata_records(ids: list[aoptk.literature.id.ID]) -> list[Any] Retrieve publication metadata records based on the list of IDs. .. py:method:: _batch_requests(ids: list[aoptk.literature.id.ID], func: collections.abc.Callable[Ellipsis, Any]) -> list[Any] Helper function to batch requests to NCBI. .. py:method:: _async_get_ids(search_term: str) -> list[aoptk.literature.id.ID] :async: Asynchronously retrieve a list of publication IDs based on the search term. .. py:method:: _get_publication_count_and_ids(search_term: str, mindate: str | None = None, maxdate: str | None = None) -> tuple[int, list[str]] Helper function to retrieve the count of publications and their IDs. Retrieves IDs and total count based on the given search term and an optional date range. .. py:method:: _async_get_publication_count_and_ids(search_term: str, mindate: str | None = None, maxdate: str | None = None) -> tuple[int, list[str]] :async: Asynchronously retrieve the count of publications and their IDs based on the search term and date range. .. py:method:: _collect_ids_for_year(search_term: str, year: int) -> list[str] :async: Collect publication IDs for a specific year, splitting by months and days if the count exceeds the limit. .. py:method:: _collect_ids_split_by_months_days(search_term: str, year: int) -> list[str] :async: Collect publication IDs for a specific year. Split the search into months and days to avoid exceeding the result limit.