hipscat.catalog.dataset#

Submodules#

Package Contents#

Classes#

BaseCatalogInfo

Container class for catalog metadata

Dataset

A base HiPSCat dataset that contains a catalog_info metadata file

class BaseCatalogInfo[source]#

Container class for catalog metadata

catalog_name: str = ''#
catalog_type: hipscat.catalog.catalog_type.CatalogType | None#
total_rows: int | None#
DEFAULT_TYPE#

The default catalog type for this catalog info type. To be overridden by subclasses. If specified, we will use this value when no catalog_type is provided.

REQUIRED_TYPE#

The required catalog type for this catalog info type. To be overridden by subclasses. If specified, the catalog MUST have this type.

required_fields = ['catalog_type']#
__post_init__()[source]#
__str__()[source]#

Return str(self).

classmethod read_from_metadata_file(catalog_info_file: hipscat.io.FilePointer, storage_options: Dict[Any, Any] | None = None) typing_extensions.Self[source]#

Read catalog info from the catalog_info.json metadata file

Parameters:
  • catalog_info_file – FilePointer pointing to the catalog_info.json file

  • storage_options – dictionary that contains abstract filesystem credentials

Returns:

A CatalogInfo object with the data from the catalog_info.json file

_check_required_fields()[source]#
class Dataset(catalog_info: CatalogInfoClass, catalog_path=None, storage_options: Dict[Any, Any] | None = None)[source]#

A base HiPSCat dataset that contains a catalog_info metadata file and the data contained in parquet files

CatalogInfoClass#
classmethod read_from_hipscat(catalog_path: str, storage_options: Dict[Any, Any] | None = None) typing_extensions.Self[source]#

Reads a HiPSCat Catalog from a HiPSCat directory

Parameters:
  • catalog_path – path to the root directory of the catalog

  • storage_options – dictionary that contains abstract filesystem credentials

Returns:

The initialized catalog object

classmethod _read_args(catalog_base_dir: hipscat.io.FilePointer, storage_options: Dict[Any, Any] | None = None) Tuple[CatalogInfoClass][source]#
classmethod _read_kwargs(catalog_base_dir: hipscat.io.FilePointer, storage_options: Dict[Any, Any] | None = None) dict[source]#
classmethod _check_files_exist(catalog_base_dir: hipscat.io.FilePointer, storage_options: Dict[Any, Any] | None = None)[source]#