.. include:: ../../toolkit-substitutions

.. oe:namespace:: OESaiph


.. meta::
   :keywords: OERecordToCSV, RecordToCSV


.. _OESaiph_OERecordToCSV:

.. oe:class:: OERecordToCSV

   .. attention::

      |PRELIMINARY-API|

   .. oe:api::

      class OERecordToCSV
      
   Converts an :oe:func:`OEChem::OEIsReadable` file into a CSV file. Modifications such as
   setting the delimiter type, ordering the :ref:`OEField <OEDataFlow_OEField>`, and including
   a molecule title can be set up through the :ref:`OERecordToCSVOptions <OESaiph_OERecordToCSVOptions>`.
   
   .. oe:method:: Constructors

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

         .. oe:api::

            OERecordToCSV()

      .. oe:language:: python

         .. oe:api:: python

            OERecordToCSV() -> OERecordToCSV

   .. oe:method:: Open

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

         .. oe:api::

            bool Open(const std::string& path,
                      const OERecordToCSVOptions& opts = OERecordToCSVOptions())

      .. oe:language:: python

         .. oe:api:: python

            Open(path: str,
                 opts: OERecordToCSVOptions = OESaiph_OERecordToCSVOptions()) -> bool

      Returns a boolean based on whether the file can be opened.
      :ref:`OERecordToCSVOptions <OESaiph_OERecordToCSVOptions>`
      is set at open.

   .. oe:method:: Write

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

         .. oe:api::

            bool Write(const std::string& path)
            bool Write(OEPlatform::oeostream& ofs)

      .. oe:language:: python

         .. oe:api:: python

            Write(path: str) -> bool
            Write(ofs: oeostream) -> bool

      Writes the CSV to a file path or into a stream.

