read_index

astro_metadata_translator.indexing.read_index(path: str, *, force_dict: Literal[True]) MutableMapping[str, Union[MutableMapping[str, Any], ObservationInfo]]
astro_metadata_translator.indexing.read_index(path: str, *, force_dict: Literal[False]) Union[ObservationGroup, MutableMapping[str, Union[MutableMapping[str, Any], ObservationInfo]]]

Read an index file.

Parameters:
pathstr

Path to the index file.

force_dictbool, optional

If True the structure returned will always be a dict keyed by filename.

Returns:
index_ObservationGroup or dict[str, Union[dict, ObservaitonInfo]]

The return content matches that returned by process_index_data.