Skip to main content

PubmedTools (pubmedtools)

PubmedTools (pubmedtools) package provides functions for searching and retrieving articles from the PubMed database using Biopython and NCBI Entrez Direct. This is not an official NCBI library and has no direct affiliation with the organization.



Features

  • pubmedtoos.search.biopython_search: Searches the PubMed database using a Biopython Entrez module (Bio.Entrez).
  • pubmedtoos.search.edirect_search: Searches the PubMed database using the official Entrez Direct tool.
  • pubmedtoos.prepenv.edirect_folder: Prepares the Entrez Direct folder for use with the edirect_search function.


Installation

You can install PubmedTools using pip:

pip install pubmedtools


Functions


Searches the PubMed database using a given term and retrieves the abstract, title, publication date, authors, MeSH terms, and other terms related to each article. This function use the Bio.Entrez module from Biopython. The search is limited to 10,000 results.

Parameters

  • term : str
    • The search term to be used in the query.
  • email : str, optional
    • Email address to be used in case the Entrez server needs to contact you.
  • api_key : str, optional
    • API key to access the Entrez server.
  • batch_size : int, optional
    • Number of articles to be downloaded per iteration. Default is 1000.
  • verbose : bool, optional
    • Whether to print progress messages. Default is True.

Returns

  • pandas.DataFrame
    • A DataFrame with columns 'pmid', 'ti', 'ab', 'fau', 'dp', 'mh', and 'ot'.
    • Each row contains information related to a single article retrieved from the search term query.

Raises

Exception - If the search returns more than 10,000 results, which is the limit of this function. In this case, the user should use the pubmedtools.search.edirect_search function.

Searches the PubMed database using a given term and retrieves the abstract, title, publication date, authors, MeSH terms, and other terms related to each article. This function use the official NCBI Entrez Direct tool.

Parameters

  • query : str
    • The query to be searched in PubMed.
  • api_key : str, optional
    • The NCBI API key. If not provided, the search will be performed without the API key.

Returns

  • pandas.DataFrame
    • A pandas DataFrame containing the search results.

Notes

  • This function works with Linux and Windows systems using WSL (Windows Subsystem for Linux).

Raises

  • Exception
    • If the operating system is not recognized.

prepenv


pubmedtools.prepenv.edirect_folder

Function to prepare the edirect folder for pubmed_search_edirect. Checks in pubmedtools package path if the edirect folder exists and contains the necessary files. If not, it downloads and extracts the required files.

Metadata

Release files for pubmedtools 0.0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pubmedtools 0.0.0.2
File Size Uploaded
pubmedtools-0.0.0.2.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pubmedtools 0.0.0.2
File Interpreter ABI Platform
pubmedtools-0.0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 12.1 kB

Release files / pubmedtools-0.0.0.2.tar.gz

Download URL pubmedtools-0.0.0.2.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8ad1bd3682227122ba6ebed5bba3b0f1ed27d00c43f980be4828f1bc672ac817
BLAKE2b-256 checksum
How to use checksums
98f0d9778fd39479d9395c6801612fb664ac8b0db32b7eac54c07d3d0f2593da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / pubmedtools-0.0.0.2-py3-none-any.whl

Download URL pubmedtools-0.0.0.2-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
089e2a7e15f723e8d6d248642a0c14dbc2357323ea33a79e656b7319b1eb999f
BLAKE2b-256 checksum
How to use checksums
218544c0cbd927f09e89461e9165d038038fc5116b21be039a01c14b781142d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release history Release notifications | RSS feed

This release

0.0.0.2 This release

2 release files

0.0.0.1

1 release file

0.0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page