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

.. oe:namespace:: OESaiph


.. meta::
   :keywords: ArchiveConverter


.. _OESaiph_ArchiveConverter:

.. oe:class:: ArchiveConverter

   .. attention::

      |PRELIMINARY-API|
      |PYTHONONLY|

   .. oe:api::

      class ArchiveConverter

   :ref:`ArchiveConverter <OESaiph_ArchiveConverter>` is an iterator class which converts tarball or
   zip files into :ref:`OERecord <OEDataFlow_OERecord>`. This class provides the best-suited
   converter iterator for each file in the compressed file as it iterates. This provides the utility
   of combining multiple datasets with the same :ref:`OERecord <OEDataFlow_OERecord>` setup into one large
   :ref:`OERecord <OEDataFlow_OERecord>` or creating multiple :ref:`OERecord <OEDataFlow_OERecord>`
   for each file in the compressed file.
   
   .. oe:method:: Constructors

      .. oe:api::

         ArchiveConverter(path: str)

      .. code-block:: python
         :linenos:

         from openeye import oechem, oesaiph

         path = "path_to_file.zip"         
         for convs in ArchiveConverter(path):
            # provides the best-suited converter iterator

            for rec in convs:
               # iterates through each record in the file found in the compressed file