Skip to content

collections.index

CollectionIndex

Bases: SlottedDict[Collection]

Index object through which all collections can be accessed.

Provides dictionary-like functionality mapping collection IDs to Collection objects in the Anthology.

Attributes:

Name Type Description
parent Anthology

The parent Anthology instance to which this index belongs.

is_data_loaded bool

A flag indicating whether the XML directory has already been indexed.

load

load()

Finds all XML data files and indexes them by their collection ID.

Note

Currently assumes that XML files are always named according to the collection ID they contain; i.e., a file named "L16.xml" must contain the collection with ID "L16".