hats.io.file_io.file_pointer
============================

.. py:module:: hats.io.file_io.file_pointer


Attributes
----------

.. autoapisummary::

   hats.io.file_io.file_pointer.BLOCK_SIZE


Functions
---------

.. autoapisummary::

   hats.io.file_io.file_pointer.get_upath
   hats.io.file_io.file_pointer.get_upath_for_protocol
   hats.io.file_io.file_pointer.filter_query_params_for_url
   hats.io.file_io.file_pointer.directory_has_contents


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

.. py:data:: BLOCK_SIZE
   :value: 32768


.. py:function:: get_upath(path: str | pathlib.Path | upath.UPath) -> upath.UPath

   
   Returns a UPath file pointer from a path string or other path-like type.


   :Parameters:

       **path: str | Path | UPath**
           base file path to be normalized to UPath



   :Returns:

       UPath
           Instance of UPath.











   ..
       !! processed by numpydoc !!

.. py:function:: get_upath_for_protocol(path: str | pathlib.Path) -> upath.UPath

   
   Create UPath with protocol-specific configurations.

   If we access pointers on S3 and credentials are not found we assume
   an anonymous access, i.e., that the bucket is public.

   :Parameters:

       **path: str | Path | UPath**
           base file path to be normalized to UPath



   :Returns:

       UPath
           Instance of UPath.











   ..
       !! processed by numpydoc !!

.. py:function:: filter_query_params_for_url(url: str, query_params: dict) -> dict

   
   Return a copy of ``query_params`` with any keys unsupported by the target
   host removed.

   Currently the only special case is VizCaT (``vizcat.cds.unistra.fr``), which
   does not support server-side ``filters``.

   :Parameters:

       **url** : str
           Full URL of the catalog resource (used only to inspect the host).

       **query_params** : dict
           Query parameters dict as produced by
           :func:`~hats.io.paths.dict_to_query_urlparams`.



   :Returns:

       dict
           Filtered copy of ``query_params``.











   ..
       !! processed by numpydoc !!

.. py:function:: directory_has_contents(pointer: str | pathlib.Path | upath.UPath) -> bool

   
   Checks if a directory already has some contents (any files or subdirectories)


   :Parameters:

       **pointer** : str | Path | UPath
           File Pointer to check for existing contents



   :Returns:

       bool
           True if there are any files or subdirectories below this directory.











   ..
       !! processed by numpydoc !!

