reportcompiler.plugins.data_fetchers.base
¶
base.py
This module includes the base plugin interface for data fetchers.
Classes¶
DataFetcher
: Plugin that implements the data fetching stage for a fragment.
-
class
reportcompiler.plugins.data_fetchers.base.
DataFetcher
¶ Plugin that implements the data fetching stage for a fragment.
Inheritance
-
fetch
(doc_param, fetcher_info, metadata)¶ Fetches the necessary data for the current fragment.
Parameters: - doc_param (OrderedDict) – Document variable
- fetcher_info (dict) – Information about the current fetcher (multiple can be used for fragment)
- metadata (dict) – Document metadata (overriden by fragment metadata when specified)
Returns: Dataframe (or list of dataframes)
Return type: pandas.DataFrame
-
classmethod
raise_data_fetching_exception
(context, exception=None, message=None)¶ Returns a data fetching exception with the necessary info attached.
Parameters: - context (dict) – Context for fragment
- exception (Exception) – Exception returned by data fetching
- message (str) – Optional message for exception
Raises: DataFetchingError – always
-