.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEParseInChI

.. oe:function:: OEParseInChI

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

      .. oe:api::

         bool OEParseInChI(OEMolBase& mol, const std::string& str)

   .. oe:language:: python

      .. oe:api:: python

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

   Parses a :term:`InChI` string into a molecule.
   The returned value indicates whether the given :term:`InChI` string was parsed
   successfully.

   mol
    The constructed molecule.

   str
    The :term:`InChI` string that is parsed into the molecule.

   The input molecule instance is not cleared so these functions can be used
   to add components to an existing molecule.

   .. hint::

      The use of the high-level :oe:func:`OEChem::OEInChIToMol` function is
      highly recommended over the low-level :oe:func:`OEChem::OEParseInChI` function.
      The :oe:func:`OEChem::OEInChIToMol` function not only converts
      an :term:`InChI` string into a molecule but also perceives basic molecular
      properties.

   .. seealso::

      * :oe:func:`OEChem::OEMolToSTDInChI` function
      * :oe:func:`OEChem::OEMolToInChI` function
      * :oe:func:`OEChem::OEInChIToMol` function
      * :oe:func:`OEChem::OECreateInChI` function
      * :ref:`section_molctordtor_inchifrommol` section
