Skip to main content

pubchem-property-fetcher

A CLI tool and Python API to resolve chemical SMILES strings and batch-fetch properties using the PubChem PUG REST API.

It handles SMILES canonicalization via RDKit, groups properties to minimize API calls, respects PubChem's rate limits, and uses exponential backoff to handle server-side throttling (429, 503). Results are exported as CSV using Polars.

Installation

Ensure you have Python 3.10+ installed. Install the package including its dependencies:

pip install pubchem-property-fetcher

Usage

CLI

Run the script directly from the command line. Pass in SMILES strings, specify the properties, and set an output file. If no output is provided, it prints the CSV to standard output.

# Fetch MolecularWeight and IUPACName
python -m pubchem_property_fetcher "OCC.CC" "CCO" "CCC" \
    --properties MolecularWeight --properties IUPACName \
    --output results.csv

Special Properties:

  • --properties synonyms: Fetches common aliases for the structures. Limit the amount returned with --max-synonyms N.
  • --properties label: A custom pipeline property that heuristically picks the most human-readable name from the synonym list, falling back to the formal IUPAC name if no good synonyms exist.

For standard properties like MolecularWeight, XLogP, ExactMass, or TPSA, see the PubChem PUG REST Docs.

Python API

import asyncio
from typing import Any

from pubchem_property_fetcher import (
    PubChemClient,
    clean_smiles,
    fetch_cid_bulk,
    fetch_properties_bulk,
)


# fetch properties
async def main() -> dict[int, dict[str, Any]]:
    # standardize SMILES
    smiles = clean_smiles(["CCO", "CCC"])

    async with PubChemClient() as client:
        # get PubChem Compound IDs (CIDs)
        cids_map = await fetch_cid_bulk(smiles, client)
        cids = list(cids_map.values())
        return await fetch_properties_bulk(cids, ["IUPACName", "MolecularWeight"], client)


print(asyncio.run(main()))
# {702: {'IUPACName': 'ethanol', 'MolecularWeight': 46.07}, ...}

Metadata

Release files for pubchem-property-fetcher 0.1.4

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

Source distribution (sdist)

Source distribution for pubchem-property-fetcher 0.1.4
File Size Uploaded Provenance Actions
pubchem_property_fetcher-0.1.4.tar.gz 12.6 kB With provenance Details for pubchem_property_fetcher-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pubchem-property-fetcher 0.1.4
File Interpreter ABI Platform Actions
pubchem_property_fetcher-0.1.4-py3-none-any.whl Python 3 none any Details for pubchem_property_fetcher-0.1.4-py3-none-any.whl

Total release size: 21.8 kB

Release files / pubchem_property_fetcher-0.1.4.tar.gz

Download URL pubchem_property_fetcher-0.1.4.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fbbd167dce11b59f00c55bb59a6238013179f913be740db6cd2d853e7188f96a
BLAKE2b-256 checksum
How to use checksums
e0e9e6555a1c4c137df0a411911da116e8d0b4acd96d236dd30eb9930200067e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / pubchem_property_fetcher-0.1.4-py3-none-any.whl

Download URL pubchem_property_fetcher-0.1.4-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ccef17c9597a73fb3682ed33c77d79c6877dd51100f8cff33062a88e53f3681c
BLAKE2b-256 checksum
How to use checksums
3bdbbc64c1781a2032de5c91079d84777180a3aa602534ec09997db84d6b39cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Security for pubchem-property-fetcher 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pubchem_property_fetcher-0.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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