PubMed Source

PubMed manual browsing using NCBI E-utilities (ESearch + ESummary).

No additional dependencies required. Network calls use requests and return lightweight SearchItem objects with stable PubMed IDs.

class agent.browsing.manual.sources.pubmed.PubMedBrowser(*args, **kwargs)[source]

Bases: ManualSource

Manual source for PubMed articles using E-utilities JSON endpoints.

iter_all(query, chunk_size=100, limit=None, **kwargs)[source]

Iterate through PubMed results by fetching in chunks.

Parameters:
  • query (str) – Free-text query string.

  • chunk_size (int) – Number of results per request.

  • limit (Optional[int]) – Optional maximum number of items to yield.

  • kwargs (object)

Return type:

Iterator[SearchItem]

Returns:

Iterator over normalized search items.

search(query, max_results=25, start=0, **kwargs)[source]

Search PubMed and return a page of results.

This uses esearch.fcgi to obtain a list of PMIDs, then esummary.fcgi to fetch basic metadata.

Parameters:
  • query (str) – Free-text query string.

  • max_results (int) – Maximum number of results to return.

  • start (int) – Zero-based start index for pagination.

  • kwargs (object)

Return type:

List[SearchItem]

Returns:

List of normalized search items with PMIDs.

search_all(query, chunk_size=100, limit=None, **kwargs)[source]

Collect PubMed results for a query into a list.

Parameters:
  • query (str) – Free-text query string.

  • chunk_size (int) – Number of results per request.

  • limit (Optional[int]) – Optional maximum number of items to collect.

  • kwargs (object)

Return type:

List[SearchItem]

Returns:

List of normalized search items.