
    +d                         d dl Z d dlZd dlZd dlZd dlZddlmZ  e            d         Z[ddlm	Z	 ddl
mZ ddd	d
ddddddd
Z ej        d          Zd Zd ZddZdS )    N   )get_versionsversion)Catalog)registryzintake.source.base:DataSourcezintake.source.base:Schemaz)intake.catalog.default:load_combo_catalogzintake.container:uploadzintake.interface:instancezintake.interfacezintake.catalog:builtinz intake.interface:output_notebookzintake.source:register_driverzintake.source:unregister_driver)

DataSourceSchemaload_combo_cataloguploadgui	interfacecatoutput_notebookregister_driverunregister_driverintakec                 D   t                      }| dk    rt                      S | |v r||          S | t          v rt          |          }|                    dd          d         }t                              d|z             t          j        |          }d|v r)t          ||                    d          d                   }||| <   |S | dd         dk    r?| dd         t          j
                                        v rt          | dd                  }|S t          |           )	aB  Lazy attribute propagator

    Defers inputs of functions until they are needed, according to the
    contents of the ``imports`` (submodules and classes) and ``openers``
    (functions which instantiate data sources directly)
    dicts. All keys in ``openers``
    must start with "open_", else they will be ignored.
    __all__:r   r   zImporting: %sN   open_)globals__dir__importssplitloggerdebug	importlibimport_modulegetattrr   driversenabled_pluginsAttributeError)attrgldestmodnamemoddrivers         /lib/python3.11/site-packages/intake/__init__.py__getattr__r+   %   s"    
By yyrz $xw t}**S!$$Q'_w.///%g..$; 	3#tzz#q122C4
BQBx7 tABBx8+;+K+K+M+MM $qrr(#


    c                      d t           j                                        D             }t          t	          t                                t	          t                    z   |z             S )Nc                     g | ]}d |z   S )r    ).0names     r*   
<listcomp>z__dir__.<locals>.<listcomp>H   s    MMM$w~MMMr,   )r   r!   r"   sortedlistr   r   )___openerss      r*   r   r   G   sL    MM(*:*J*J*L*LMMMG$wyy//DMM1G;<<<r,   c           
      v   |                     dd          }t          | t          j                  rt          j        |           } |	| rt          | t
                    rd| v s/t          | t          t          f          rt          |           dk    rd}nt          | t          t          f          r+t          |           dk    r| d         } d| d         v rd}nwd}ntt          | t
                    rK| 	                    d          rd	}nG| 
                    d
          rd}n/|                     d          dz   } d}nt          d| z            d}d|vr|                     dd           |t          vr4t          d|dt          t          t                                        t          |         | fi |S )a  Create a Catalog object

    Can load YAML catalog files, connect to an intake server, or create any
    arbitrary Catalog subclass instance. In the general case, the user should
    supply ``driver=`` with a value from the plugins registry which has a
    container type of catalog. File locations can generally be remote, if
    specifying a URL protocol.

    The default behaviour if not specifying the driver is as follows:

    - if ``uri`` is a single string ending in "yml" or "yaml", open it as a
      catalog file
    - if ``uri`` is a list of strings, a string containing a glob character
      ("*") or a string not ending in "y(a)ml", open as a set of catalog
      files. In the latter case, assume it is a directory.
    - if ``uri`` begins with protocol ``"intake:"``, connect to a remote
      Intake server
    - if ``uri`` is ``None`` or missing, create a base Catalog object without entries.

    Parameters
    ----------
    uri: str or pathlib.Path
        Designator for the location of the catalog.
    kwargs:
        passed to subclass instance, see documentation of the individual
        catalog classes. For example, ``yaml_files_cat`` (when specifying
        multiple uris or a glob string) takes the additional
        parameter ``flatten=True|False``, specifying whether all data sources
        are merged in a single namespace, or each file becomes
        a sub-catalog.

    See also
    --------
    intake.open_yaml_files_cat, intake.open_yaml_file_cat,
    intake.open_intake_remote
    r)   N*r   yaml_files_catr   yaml_file_catzintake:intake_remote)z.ymlz.yaml/z/*.y*mlzURI not understood: %scatalog_filefszUnknown catalog driver (z), supply one of: )pop
isinstanceosPathLikefspathstrr4   tuplelen
startswithendswithrstrip
ValueErrorr   r3   )urikwargsr)   s      r*   open_catalogrO   L   s   J ZZ$''F#r{## inn  	3$$ A A*S4QV-:X:X A^abe^f^fij^j A)C$// ACHHM A!f#a&= --FF -FFC%% A>>),, 2,FF||$566 2!0!jjoo	9!1 !9C!?@@@ Ff 

4X njVVVUYZ`aiZjZjUkUkUklmmmFC**6***r,   )N)r   loggingrC   rewarnings_versionr   __version__catalog.baser   sourcer   r   	getLoggerr   r+   r   rO   r/   r,   r*   <module>rX      s        				 				  " " " " " "lnnY' ! ! ! ! ! !       2)E'&##96:  
	8	$	$  D= = =
I+ I+ I+ I+ I+ I+r,   