skillfed

PubChemPy

A simple Python wrapper around the PubChem PUG REST API.

pubchempy v1.0.5 5.4M downloads/30d#2,110 on PyPI514
Permissive license MIT AGING released

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 pubchempy

uv

uv add pubchempy

poetry

poetry add pubchempy

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Healthcare IndustryIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Database :: Front-EndsTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Bio-InformaticsTopic :: Scientific/Engineering :: ChemistryTopic :: Scientific/Engineering :: Medical Science Apps.Topic :: Software Development :: Libraries :: Python Modules

Tags

pubchem api python wrapperchemical compound searchmolecular property retrievalcheminformatics librarychemical structure lookupsmiles molecular weightcompound database query
chemistryapi-wrappercheminformatics

More Scientific/Engineering packages