Refactor the entire module for equivalent functionality but to change the data structure.
Either a dataframe, with relevant data in each column for faster programmatic processing, and the PlexAPI objects added in columns for interacting with the API (Track, Album, Artist).
Or create a dataclass for each entity and re-create the hierarchy (though perhaps more loosely?) in the module as its own thing.
Refactor the entire module for equivalent functionality but to change the data structure.
Either a dataframe, with relevant data in each column for faster programmatic processing, and the PlexAPI objects added in columns for interacting with the API (Track, Album, Artist).
Or create a dataclass for each entity and re-create the hierarchy (though perhaps more loosely?) in the module as its own thing.