Search the smiles by name or search the name by smiles using pubchempy. For more information: http://pubchempy.readthedocs.io
Pubchempy is a python wrapper for the PubChem PUG REST API. The original codes are placed in the directory named "pubchempy" Two simple ways to install the pubchempy:
>>> pip install pubchempy
>>> conda install -c mcs07 pubchempy
Search the SMILES of Glucose
>>> from pubchempy import get_compounds
>>> results = get_compounds('Glucose', 'name')
>>> print(results)
[Compound(79025), Compound(5793), Compound(64689), Compound(206)]
>>> print(results[0].isomeric_smiles)
>>> C([C@@H]1[C@H]([C@@H]([C@H]([C@H](O1)O)O)O)O)O
Search by CAS
>>> results = get_compounds('81982-32-3', 'name')
>>> results
[Compound(71253)]
>>> print(results[0].isomeric_smiles)
'CNS(=O)(=O)C1=C(C=C(C(=C1)C(=O)NCC2CCCN2CC=C)OC)N'
>>> c = get_compounds('C1=CC2=C(C3=C(C=CC=N3)C=C2)N=C1', 'smiles')
>>> c
[Compound(1318)]
>>> c[0].iupac_name
'1,10-phenanthroline'
>>> c[0].synonyms
['1,10-phenanthroline',
'o-phenanthroline',
'66-71-7',...]
>>> from pubchempy import Compound
>>> c = Compound.from_cid(5090)
>>> print(c.isomeric_smiles)
CS(=O)(=O)C1=CC=C(C=C1)C2=C(C(=O)OC2)C3=CC=CC=C3
PubChem Identifier Exchange Service:
ID exchange service support by pubchem.
A package written in Python.
This page lets you easily convert compound names, IUPAC names, SMILES codes and CAS numbers into chemical structures.
Convert name to structure by toolkits of ChemAxon.
Python wrapper for the ChemSpider API.