In [2]:
from rdkit import Chem

In [3]:
m = Chem.MolFromSmiles('Cc1ccccc1')

In [4]:
m


Out[4]:
<rdkit.Chem.rdchem.Mol at 0x7fe1754a4c10>

In [5]:
Chem.Kekulize(m)

In [6]:
Chem.MolToSmiles(m,kekuleSmiles=True)


Out[6]:
'CC1=CC=CC=C1'

In [7]:
from rdkit.Chem import Draw

In [8]:
fig = Draw.MolToMPL(m)

In [9]:
fig


Out[9]:
<matplotlib.figure.Figure at 0x7fe17266a390>

In [10]:
%matplotlib inline

In [11]:
fig


Out[11]:

In [14]:
m2 = Chem.MolFromSmiles('C1=C2C(=CC(=C1Cl)Cl)OC3=CC(=C(C=C3O2)Cl)Cl')
fig2 = Draw.MolToMPL(m2)



In [ ]:

How did we get here

  • regular anaconda install
conda install -c https://conda.binstar.org/rdkit rdkit
  • %matplotlib inline
from rdkit import Chem
from rdkit.Chem import Draw

In [ ]: