CompustatDataLoader

Description

CompustatDataLoader provides access to Compustat data from local files. It applies filters, organizes data into xarray.Dataset, and supports caching.

Inherits

  • BaseDataSource

Methods

load_data

def load_data(self, **config) -> xr.Dataset:

  • Description: Loads data from the Compustat source file, with optional caching.

  • Parameters:

    • columns_to_read (list): Columns to read.

    • filters (dict): Filters to apply.

    • num_processes (int): Number of processes for loading data.

    • **kwargs: Additional arguments.

  • Returns: xarray.Dataset with the requested data.


_load_from_cache

def _load_from_cache(self, cache_path: Path) -> xr.Dataset:

  • Description: Loads data from the local cache.

  • Parameters:

    • cache_path (Path): Path to the cache file.

  • Returns: Cached xarray.Dataset.


_load_from_source

def _load_from_source(self, columns_to_read: List[str], filters: Dict[str, Any], funda_path: str, cache_path: Path, num_processes: int, params: dict) -> xr.Dataset:

  • Description: Loads data from the Compustat file, applies filters, and caches it.

  • Parameters:

    • columns_to_read (list): Columns to read.

    • filters (dict): Filters to apply.

    • funda_path (str): Path to the Compustat file.

    • cache_path (Path): Path to the cache file.

    • num_processes (int): Number of processes for loading.

    • params (dict): Metadata for caching.

  • Returns: Processed xarray.Dataset

Last updated