aoptk.literature.databases.pmc ============================== .. py:module:: aoptk.literature.databases.pmc Classes ------- .. autoapisummary:: aoptk.literature.databases.pmc.PMC Module Contents --------------- .. py:class:: PMC(storage: pathlib.Path, figure_storage: pathlib.Path, query: aoptk.literature.query.Query | None = None) Bases: :py:obj:`aoptk.literature.get_publication.GetPublication`, :py:obj:`aoptk.literature.get_pdf.GetPDF`, :py:obj:`aoptk.literature.get_id.GetID`, :py:obj:`aoptk.literature.get_abstract.GetAbstract`, :py:obj:`aoptk.literature.get_metadata.GetMetadata` Class to get data from PMC based on a query. .. py:attribute:: aws_region :value: 'us-east-1' .. py:attribute:: s3 .. py:attribute:: bucket :value: 'pmc-oa-opendata' .. py:attribute:: paginator .. py:attribute:: image_extensions :value: ('.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.tif') .. py:attribute:: unified_image_format :value: 'png' .. py:attribute:: search_term .. py:attribute:: _ncbi .. py:attribute:: storage .. py:attribute:: figure_storage .. py:method:: build_search_term(query: aoptk.literature.query.Query) -> str Convert Query to PMC search syntax. .. py:method:: _get_license_filter(licensing: str) -> str Get the license filter string for a given licensing type. :param licensing: The licensing type. :type licensing: str :returns: The license filter string for PMC search. :rtype: str .. py:method:: get_pdfs(ids: list[aoptk.literature.id.ID]) -> list[aoptk.literature.pdf.PDF] Retrieve PDFs. :returns: A list of PDF objects. :rtype: list[PDF] .. py:method:: get_publications(ids: list[aoptk.literature.id.ID], download_figures_enabled: bool = True) -> list[aoptk.literature.publication.Publication] Get a list of publications. :param ids: A list of publication IDs to retrieve. :type ids: list[ID] :param download_figures_enabled: Whether to download figures :type download_figures_enabled: bool :param and include their paths in the Publication objects.: :returns: A list of Publication objects. :rtype: list[Publication] .. py:method:: get_ids() -> list[aoptk.literature.id.ID] Retrieve a list of publication IDs based on the search term. .. py:method:: get_abstracts(ids: list[aoptk.literature.id.ID]) -> list[aoptk.literature.abstract.Abstract] Retrieve Abstracts based on the list of IDs. .. py:method:: _parse_pmc_abstract_records(records: list[Any]) -> list[aoptk.literature.abstract.Abstract] Parse PMC abstract handles and return a list of Abstract objects. :param records: A list of PMC Entrez fetch handles. :type records: list[Any] .. py:method:: get_publications_metadata(ids: list[aoptk.literature.id.ID]) -> list[aoptk.literature.metadata.Metadata] Retrieve Publication metadata. :param ids: A list of publication IDs for which to retrieve metadata. :type ids: list[ID] .. py:method:: _parse_pmc_metadata_records(records: list[str]) -> list[aoptk.literature.metadata.Metadata] Parse PMC metadata records and return a list of PublicationMetadata objects. :param records: A list of PMC XML summary payloads. :type records: list .. py:method:: _get_publication(publication_id: aoptk.literature.id.ID, download_figures_enabled: bool = True) -> aoptk.literature.publication.Publication | None Parse a single PDF and return a Publication object. :param publication_id: The publication ID to retrieve and parse. :type publication_id: str :param download_figures_enabled: Whether to download figures :type download_figures_enabled: bool :param and include their paths in the Publication object.: .. py:method:: _get_full_text(publication_id: aoptk.literature.id.ID) -> str | None Retrieve the full text for a given publication ID. :param publication_id: The publication ID to retrieve the full text for. :type publication_id: str .. py:method:: _get_file(publication_id: aoptk.literature.id.ID, file_format: str) -> pathlib.Path | None Retrieve the file for a given publication ID and format. :param publication_id: The publication ID to retrieve the file for. :type publication_id: str :param file_format: The format of the file to retrieve (pdf, xml, json, or txt). :type file_format: str :param Formats txt: :param xml: :param pdf contain full-text: :param while json contains metadata.: .. py:method:: _get_figures(publication_id: aoptk.literature.id.ID) -> list[pathlib.Path] Retrieve the figure files for a given publication ID. :param publication_id: The publication ID to retrieve the figure files for. :type publication_id: ID .. py:method:: _extract_figures_from_supplements(publication_id: aoptk.literature.id.ID, supplementary_files: list[str]) -> list[pathlib.Path] Extract figure files from the supplementary files. :param publication_id: The publication ID to retrieve the figure files for. :type publication_id: ID :param supplementary_files: A list of supplementary file URLs to extract figures from. :type supplementary_files: list[str] .. py:method:: _get_json(publication_id: aoptk.literature.id.ID) -> dict[str, Any] | None Retrieve the json for a given publication ID. :param publication_id: The publication ID to retrieve the json for. :type publication_id: str .. py:method:: _get_pdf(publication_id: aoptk.literature.id.ID) -> aoptk.literature.pdf.PDF | None Retrieve the PDF for a given publication ID. :param publication_id: The publication ID to retrieve the PDF for. :type publication_id: str