calculate_index

astro_metadata_translator.indexing.calculate_index(headers: MutableMapping[str, MutableMapping[str, Any]], content_mode: str) MutableMapping[str, str | MutableMapping[str, Any]]

Calculate an index data structure from the supplied headers.

Parameters:
headersdict of [str, dict]

The headers indexed by filename.

content_modestr

The mode associated with these headers. Not used other than to store the information in the data structure for later use on deserialization.

Returns:
index_dict of [str, dict]

The headers in form suitable for writing to an index.