Spaces:
Runtime error
Runtime error
A newer version of the Gradio SDK is available:
6.2.0
metadata
title: RDKit API
emoji: 🔬
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 4.44.1
app_file: app.py
pinned: false
RDKit API
This is a Hugging Face Space providing API access to various RDKit cheminformatics functions.
Endpoints
POST /api/name_to_smiles: Convert chemical name to SMILESPOST /api/name_to_3d_molecule: Generate 3D molecule visualizationPOST /api/smiles_to_mol: Convert SMILES to canonical SMILESPOST /api/molecular_weight: Calculate molecular weightPOST /api/logp: Calculate logP (partition coefficient)POST /api/tpsa: Calculate TPSA (topological polar surface area)POST /api/chemiscope_explorer: Build a Chemiscope dataset + visualization from a batch of SMILESPOST /api/reaction_visualizer: Generate SVG visualization of chemical reactions from reaction SMILESPOST /api/mol_image: Generate 2D molecule image (returns PIL Image)
Usage
To deploy on Hugging Face Spaces, upload this repository.
For local testing, run:
pip install -r requirements.txt
python app.py
The API endpoints can be accessed programmatically using the Gradio client or HTTP requests.
Chemiscope-powered exploration
The new Chemiscope Explorer tab leverages the official chemiscope Python package plus the standalone Chemiscope web viewer to create rich, shareable datasets directly inside the Space:
- Paste up to 12 SMILES (one per line or comma-separated). RDKit generates 3D ETKDG conformers, computes descriptors (MolWt, logP, TPSA, H-bond counts, rotatable bonds) and per-atom Gasteiger charges.
- The resulting ASE frames and descriptors are converted into the Chemiscope JSON schema and embedded with the
chemiscope_standalone.htmlviewer so you can explore structures + map plots without leaving the Space. - Download the
.json.gzartifact and reload it later on chemiscope.org via the Load/Save menu or by hosting it and passing?load=<url>to share interactive analyses with collaborators.
This flow keeps the Hugging Face interface lightweight while exposing the full Chemiscope feature set for interactive dataset mining.