PubChemPy
A simple Python wrapper around the PubChem PUG REST API.
What it is and what it does
PubChemPy is a lightweight Python interface to PubChem, the U.S. National Library of Medicine's free chemistry database. It abstracts the REST API into a simple object-oriented API, letting you retrieve compound records by identifier, search by chemical name or structure, and access properties like SMILES notation, molecular weight, and IUPAC names. The package has no external dependencies beyond Python itself, making it easy to integrate into chemistry, cheminformatics, and drug discovery workflows.
The library is mature (first released in 2013) and supports modern Python versions (3.10 through 3.13). It is classified as Production/Stable and targets developers, researchers, and healthcare professionals. The aging maintenance status reflects a gap since the last release, but the repository remains available and the API is stable.
Use it for:
- Look up chemical compound properties and identifiers by name for research or data enrichment.
- Retrieve SMILES strings and molecular descriptors for cheminformatics analysis or machine learning.
- Perform substructure and similarity searches to find related compounds in PubChem.
- Automate batch queries of compound data for drug discovery or chemical inventory systems.
- Convert between chemical file formats and standardize chemical representations.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PubChemPy is a Python wrapper around the PubChem REST API that lets you search for chemical compounds by name, substructure, or similarity, retrieve their properties, and convert between chemical file formats.
Yes. PubChemPy is a stable, dependency-free wrapper around a reliable public API with no known vulnerabilities. It is well-suited for any Python project that needs to query chemical compound data. The aging maintenance is a minor concern—the last release was 340 days ago—but the codebase is Production/Stable, supports current Python versions, and the underlying PubChem API is maintained by the NIH. Install it if you need programmatic access to PubChem data.
Install
pubchempy on PyPI
pip
pip install pubchempyuv
uv add pubchempypoetry
poetry add pubchempyInstalling PubChemPy
Before you install
Installation is straightforward with low friction; the package has no runtime dependencies. Maintenance is aging—the last release was 340 days ago—but the repository remains active with recent commits and the codebase is marked as Production/Stable.
License in practice
MIT license is permissive; you can use, modify, and distribute this package with minimal legal restrictions, as long as you include the license notice.
Quickstart
pip install pubchempy
import pubchempy as pcp
comp = pcp.Compound.from_cid(1423)
print(comp.smiles, comp.iupac_name)
Requires Python 3.10 or later; also requires network access to the PubChem REST API.
Verify before relying
- Whether the PubChem API has rate limits or usage quotas that affect production workloads.
- Performance characteristics for large-scale batch queries or searches.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 340 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,402,528/month — #2,110 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pubchempy-1.0.5-py3-none-any.whl
Keywords: pubchem, python, rest, api, chemistry, cheminformatics
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
epam-indigoIndigo is a universal cheminformatics library…
permissive · top 15,000 on PyPI
py2opsinpy2opsin converts IUPAC chemical names to…
permissive · top 15,000 on PyPI
chempropChemprop trains and deploys message passing…
permissive · top 15,000 on PyPI
padelpyPaDELPy wraps the PaDEL-Descriptor Java engine…
permissive · top 15,000 on PyPI
rdkitRDKit is a chemoinformatics toolkit providing…
permissive · top 5,000 on PyPI
chemicalsRetrieves and calculates chemical properties…
permissive · top 15,000 on PyPI
pdbeccdutilsParse and process small molecule definitions…
permissive · top 15,000 on PyPI
aimsim-coreProvides core molecular featurization and…
permissive · top 15,000 on PyPI
datamolDatamol provides a pythonic layer on top of…
permissive · top 15,000 on PyPI
chembl-structure-pipelineStandardizes and salt-strips molecular…
permissive · top 15,000 on PyPI