PyMolHub SDK & REST API
One-line pip install · OpenAPI spec · curl, Python, and TypeScript examples
Install
pip install pymolhub
End-to-end workflow example
from pymolhub import MolHub
mh = MolHub(api_key="mh_live_***")
# 1. Upload + auto-normalize a molecule
mol = mh.molecules.create(
smiles="COc1cc2ncnc(Nc3ccc(F)c(Cl)c3)c2cc1OCCCN1CCOCC1",
generate_3d=True,
)
# 2. Submit a docking job — LigandHub pipeline runs automatically
job = mh.docking.submit(
receptor="1M17",
ligands=[mol.id],
pocket="auto",
exhaustiveness=8,
)
job.wait() # polls until complete
# 3. Results — PDBQT/DLG are auto-reassembled into the original SDF
results = job.results()
print(results[0].affinity_kcal_mol, results[0].pose_sdf[:80])
# 4. Parse a QM log + semantic validation
qm = mh.qm.parse("aspirin_b3lyp.log")
print(qm.homo_eV, qm.semantic_validated)
# 5. Build an ML-ready dataset
ds = mh.datasets.create(
name="EGFR mini",
molecules=[mol.id],
labels={mol.id: 0.45}, # IC50 in nM
)
loader = ds.to_torch(batch_size=32, split="train")REST endpoints
| Method | Path | Description |
|---|---|---|
| POST | /v1/molecules | Upload & normalize molecule |
| POST | /v1/docking/jobs | Submit docking job |
| GET | /v1/docking/jobs/{id} | Job status & progress |
| GET | /v1/docking/jobs/{id}/results | Affinity ranking |
| POST | /v1/qm/parse | Parse Gaussian / ORCA log |
| POST | /v1/datasets/{id}/export | Export dataset |
| POST | /v1/nl/query | Natural language → SQL/SPARQL |
Highlights
· 3,200+ GitHub stars
· 12K PyPI downloads / month
· 47 citations on Google Scholar
Version
Currentv0.4.2
API stabilityBeta
Python≥ 3.10