This repository contains a Jupyter notebook workflow that takes a Reaxys search results CSV, cleans/deduplicates InChI Keys, and enriches each unique compound using PubChem with:
- CID (PubChem compound identifier)
- SMILES (single SMILES field)
- Vendor availability (PubChem “Chemical Vendors” source category)
The notebook is written to be practical on larger datasets by deduplicating keys up front, using retries/backoff for PubChem requests, and caching results so reruns are much faster.
Typical layout (adjust to match your repo):
notebooks/query_pubchem.ipynb— main workflowREADME.mdenvironment.yml— dependencies.gitignore— ignore cache files / large inputs
Your Reaxys export CSV must contain these columns (exact names):
Reaxys Registry NumberCAS Registry NumberChemical NameInChI Key
The workflow will:
- strip whitespace from
InChI Key - drop empty / missing keys
- (optionally) create a row-deduplicated table with one row per unique key
The final table contains the original Reaxys columns plus:
CIDSMILESVendorCount— number of unique PubChem vendor source namesVendors— semicolon-separated preview of vendor names (first N; configurable)
git clone https://github.com/saramccormack/QueryPubChemVendors.git
cd QueryPubChemVendorsUsing conda (recommended)
conda env create -f environment.yml
conda activate <env-name>jupyter labThis workflow is network-bound (PubChem API calls). It is faster and more reliable when you:
Deduplicate InChI Keys before querying (major speedup if the CSV has repeats)
Use retry/backoff to handle transient connection drops or rate limiting
Use caching so reruns don’t re-query keys that already succeeded
If you run in parallel (threaded), typical tuning knobs are:
MAX_WORKERS: reduce if you see disconnects; increase cautiously if stable
request throttling/sleep: increase if you see many retries
How vendor availability is determined
Vendor information is pulled from PubChem PUG-View categories for each CID and filtered to the category:
Category == "Chemical Vendors"
Vendor “labels” are taken from SourceName entries in that category.
Note: PubChem vendor listings can change over time and the ordering is not guaranteed. This workflow reports a count and an optional preview list for convenience.
MIT License © 2026 Sara McCormack. See the LICENSE file for details.