.. include:: ../substitutions

.. oe:namespace:: OEChem

..  _OEMolToSmiles:

.. meta::
   :keywords: OEMolToSmiles

.. oe:function:: OEMolToSmiles

   .. oe:language:: c++ java csharp

      .. oe:api::

         std::string OEMolToSmiles(const OEMolBase& mol)

   .. oe:language:: python

      .. oe:api:: python

         OEMolToSmiles(mol: Union[OEGraphMol,OEMol,OEQMol]) -> str

   Creates a :term:`canonical isomeric SMILES` from a molecule
   by evoking the low-level :oe:func:`OEChem::OECreateSmiString`
   function with the :oe:const:`OEChem::OESMILESFlag::ISOMERIC` option.

   Prior to generating the :term:`canonical isomeric SMILES` the
   following properties are perceived **if necessary**:

   * The rings of the molecule are perceived by calling the
     :oe:func:`OEChem::OEFindRingAtomsAndBonds` function

   * The aromaticity is assigned by calling the
     :oe:func:`OEChem::OEAssignAromaticFlags` function using the
     :oe:const:`OEChem::OEAroModel::OpenEye` aromaticity model.

   * In case of a 3D molecule, the stereochemistry of the atoms
     and the bonds are set by calling the :oe:func:`OEChem::OE3DToAtomStereo`
     and the :oe:func:`OEChem::OE3DToBondStereo` functions, respectively.

   .. seealso::

      * :oe:func:`OEChem::OESmilesToMol` function
      * :oe:func:`OEChem::OECXSMILESToMol` function
      * :ref:`section_molctordtor_smilesfrommol` section
