torchcell.datamodels.compound_identity_curate.PubChemClient

class PubChemClient(cache_path: Path | None, min_interval_s: float = 0.25)[source]

Bases: object

Rate-limited PUG REST client with an on-disk response cache.

flush() → None[source]

Persist the response cache so a rerun skips the network.

property_by_name(name: str) → PubChemProperty | None[source]

First property row for a name, or None when PubChem reports no CID.

properties_by_cids(cids: list[int]) → dict[int, PubChemProperty][source]

Batched CID -> property lookup (one POST per _CID_BATCH CIDs).

chebi_by_cids(cids: list[int]) → dict[int, str | None][source]

Batched CID -> ChEBI CURIE, adopted only when exactly one id is listed.