Data Manager#
- class DataManager(disable_cache: bool = False)[source]#
The
DataManagerclass handles data management for patch reports, including caching, validation and exporting to Excel.Data caching can be disabled by setting
disable_cachetoTrueat runtime.- Parameters:
disable_cache (
bool) – Whether caching functionality should be disabled.
- property cache_off: bool[source]#
Indicates whether caching is disabled.
- Returns:
True if caching is disabled, False otherwise.
- Return type:
- property titles: List[PatchTitle][source]#
Retrieve and validate the current list of
PatchTitleobjects.If titles are not already loaded, they are fetched from the latest available dataset.
- Returns:
The validated list of
PatchTitleobjects.- Return type:
- Raises:
PatcherError – If validation fails.
- async export(patch_titles: List[PatchTitle], output_dir: str | Path, report_title: str, analysis: bool = False, date_format: str = '%B %d %Y', formats: set[str] | None = None) Dict[str, str][source]#
Exports patch data to the specified formats.
- Parameters:
patch_titles (
List[PatchTitle]) – A list ofPatchTitleobjects to include in the report. Defaults toself.titlesif not providedoutput_dir (
Union[str|Path]) – The directory in which to save the exported report(s).report_title (
str) – The title to use for the header in exported report(s). Defaults toHEADER_TEXTkey incom.liquidzoo.patcher.plistfile.analysis (
bool) – Denotes whether this is analysis report (affects HTML output path).date_format (
str) – The date format for PDF/HTML headers. Defaults to “%B %d %Y” (Month Day Year).formats (
Optional[set]) – A set of formats to export. Defaults to all ({“excel”, “html”, “pdf”}).
- Returns:
A dictionary containing paths to generated reports.
- Return type:
- reset_cache() bool[source]#
Removes all cached files from Cache directory. See reset.
- Returns:
True if all files were able to be removed, False otherwise.
- Return type:
- load_cached_data() List[DataFrame][source]#
Load all cached data files into a list of DataFrames.
- Returns:
List of pandas DataFrame objects with cached data.
- Return type:
List[pandas.DataFrame]