.. oe:namespace:: OEIUPAC

.. meta::
   :keywords: OECreateIUPACName

.. oe:function:: OECreateIUPACName

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

      .. oe:api::

         std::string OECreateIUPACName(const OEChem::OEMolBase& mol,
                                       const unsigned char* style = OENamStyleOpenEye,
                                       const bool warn = true)

   .. oe:language:: python

      .. oe:api:: python

         OECreateIUPACName(mol: Union[OEGraphMol,OEMol,OEQMol],
                           style: str = OENamStyleOpenEye, warn: bool = True) -> str

   This function attempts to generate a 'reasonable' IUPAC name for the
   given molecule, mol, and return the result in a string. These
   'reasonable' names attempts to be one of the recommended IUPAC names
   for a compound, however occasionally this function may fall back to
   using IUPAC 'systematic' naming for parts of a molecule. Any parts
   of a molecule that cannot be named result in the substring ``BLAH``
   appearing in the returned string.

   The optional style argument can be used to control and customize
   the style of the names generated by this function. The nine
   currently predefined name styles are  

   * :oe:const:`OEIUPAC::OEIUPAC::OENamStyleOpenEye` (the default), 
   * :oe:const:`OEIUPAC::OEIUPAC::OENamStyleIUPAC`,
   * :oe:const:`OEIUPAC::OEIUPAC::OENamStyleIUPAC79`,
   * :oe:const:`OEIUPAC::OEIUPAC::OENamStyleIUPAC93`,
   * :oe:const:`OEIUPAC::OEIUPAC::OENamStyleTraditional`,
   * :oe:const:`OEIUPAC::OEIUPAC::OENamStyleAutoNom`, 
   * :oe:const:`OEIUPAC::OEIUPAC::OENamStyleCAS`,
   * :oe:const:`OEIUPAC::OEIUPAC::OENamStyleCASIndex` and 
   * :oe:const:`OEIUPAC::OEIUPAC::OENamStyleSystematic`.

   After the name has been generated it may be translated into one of
   several languages, for example using the
   :oe:func:`OEIUPAC::OEToGerman` or :oe:func:`OEIUPAC::OEToJapanese`
   functions, then optionally capitalized
   using :oe:func:`OEIUPAC::OECapitalizeName`, and
   finally converted into a final character encoding, for example
   using :oe:func:`OEIUPAC::OEToUTF8` or :oe:func:`OEIUPAC::OEToHTML`.

   *warn*
      If ``false``, suppresses warning messages when a name cannot be generated.
