access_nri_intake.cli
=====================

.. py:module:: access_nri_intake.cli

.. autoapi-nested-parse::

   Command line interfaces for access-nri-intake

   ..
       !! processed by numpydoc !!


Attributes
----------

.. autoapisummary::

   access_nri_intake.cli.STORAGE_FLAG_PATTERN
   access_nri_intake.cli.T_catname


Exceptions
----------

.. autoapisummary::

   access_nri_intake.cli.MetadataCheckError
   access_nri_intake.cli.DirectoryExistsError


Classes
-------

.. autoapisummary::

   access_nri_intake.cli.VersionHandler


Functions
---------

.. autoapisummary::

   access_nri_intake.cli.build
   access_nri_intake.cli.concretize
   access_nri_intake.cli.metadata_validate
   access_nri_intake.cli.metadata_template
   access_nri_intake.cli.use_esm_datastore
   access_nri_intake.cli.scaffold_catalog_entry


Module Contents
---------------

.. py:data:: STORAGE_FLAG_PATTERN
   :value: 'gdata/[a-z]{1,2}[0-9]{1,2}'


.. py:data:: T_catname

.. py:exception:: MetadataCheckError

   Bases: :py:obj:`Exception`


   Common base class for all non-exit exceptions.


   Initialize self.  See help(type(self)) for accurate signature.
















   ..
       !! processed by numpydoc !!


.. py:exception:: DirectoryExistsError

   Bases: :py:obj:`Exception`


   Raised when a directory already exists and the user has not specified
   the --force flag to overwrite it.


   Initialize self.  See help(type(self)) for accurate signature.
















   ..
       !! processed by numpydoc !!


.. py:class:: VersionHandler(yaml_dict, catalog_base_path, build_base_path, version, use_parquet = False)

   .. py:attribute:: CSV_AND_PQ_SOURCES


   .. py:attribute:: yaml_dict


   .. py:attribute:: catalog_base_path


   .. py:attribute:: build_base_path


   .. py:attribute:: version


   .. py:attribute:: use_parquet
      :value: False



   .. py:property:: cat_name
      :type: T_catname



   .. py:property:: alt_name
      :type: T_catname



   .. py:property:: cat_loc
      :type: pathlib.Path



   .. py:property:: existing_cat
      :type: bool


      
      Memo-ised property to check for existing catalog file. If we don't memoize,
      then we run into mutation issues - because __call__ will write a new catalog
      partway through its execution, invaliding the checks.
















      ..
          !! processed by numpydoc !!


   .. py:property:: yaml_old
      :type: dict | None



   .. py:method:: set_versions_no_existing_cat()

      
      No existing catalog, so set min = max = current version,
      unless there are folders with the right names in the write
      directory
















      ..
          !! processed by numpydoc !!


   .. py:method:: set_versions_no_prev_vmin_vmax()

      
      Still not really sure what exactly this should be called.
















      ..
          !! processed by numpydoc !!


.. py:function:: build(argv = None)

   
   Build an intake-dataframe-catalog from YAML configuration file(s).
















   ..
       !! processed by numpydoc !!

.. py:function:: concretize(argv = None)

   
   Concretize a build by moving it to the final location and updating the paths in the catalog.json files.
















   ..
       !! processed by numpydoc !!

.. py:function:: metadata_validate(argv = None)

   
   Check provided metadata.yaml file(s) against the experiment schema
















   ..
       !! processed by numpydoc !!

.. py:function:: metadata_template(argv = None)

   
   Create an empty template for a metadata.yaml file using the experiment schema.

   Writes the template to the current working directory by default.

   Parameters:
   -----
       loc (str, Path, optional): The directory in which to save the template.
       Defaults to the current working directory.

   Returns:
   -----
       None















   ..
       !! processed by numpydoc !!

.. py:function:: use_esm_datastore(argv = None)

   
   Either creates, verifies, or updates the intake-esm datastore
















   ..
       !! processed by numpydoc !!

.. py:function:: scaffold_catalog_entry(argv = None)

