data_catalog

This module provides DataCatalog, a container that manages multiple Dataset instances rooted under a single directory, and the DatasetMeta / DatasetMetaStatusEnum helpers used to describe each discovered dataset’s health.

class afwf_fts_anything.data_catalog.DatasetMetaStatusEnum(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Possible states for a dataset discovered inside a DataCatalog root.

setting_not_found = 'setting_not_found'

The dataset directory exists but contains no {name}-setting.json file.

setting_valid = 'setting_valid'

The setting file exists and was parsed successfully.

setting_invalid = 'setting_invalid'

The setting file exists but could not be parsed (malformed JSON / schema error).

class afwf_fts_anything.data_catalog.DatasetMeta(name: str, status: DatasetMetaStatusEnum)[source]

Lightweight descriptor returned by DataCatalog.scan().

property is_valid: bool

True only when the setting file is present and well-formed.

class afwf_fts_anything.data_catalog.DataCatalog(dir_root: Path)[source]

A directory-backed registry of named datasets.

Expected layout:

dir_root/
    {dataset_name_1}/
        {dataset_name_1}-setting.json
        {dataset_name_1}-data.json
        {dataset_name_1}-index/
        icons/
    {dataset_name_2}/
        ...

Each immediate subdirectory of dir_root is treated as a potential dataset. A subdirectory is included in scan results only when a matching {name}-setting.json file is found inside it.

get_dataset(name: str) Dataset[source]

Return a Dataset for the given name rooted at dir_root/{name}.

scan() list[DatasetMeta][source]

Scan dir_root one level deep and return a DatasetMeta for each dataset.

  • Subdirectories with no matching setting file are silently skipped.

  • Subdirectories whose setting file cannot be parsed are included with status setting_invalid.

  • Results are sorted by dataset name.