read_index

astro_metadata_translator.indexing.read_index(path: str, *, force_dict: Literal[True]) MutableMapping[str, MutableMapping[str, Any] | ObservationInfo]
astro_metadata_translator.indexing.read_index(path: str, *, force_dict: Literal[False]) ObservationGroup | MutableMapping[str, 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, dict | ObservationInfo ]

The return content matches that returned by process_index_data.