data_client =========== .. py:module:: data_client Classes ------- .. autoapisummary:: data_client.DataClient Module Contents --------------- .. py:class:: DataClient(source_config: Optional[Dict[str, Dict[str, Any]]] = None) The main public interface (Facade) for fetching data and metadata. It selects, delegates, and caches the appropriate vendor adapter. .. py:attribute:: ADAPTER_MAPPING :type: Dict[str, Type[cryptodatapy.extract.adapters.base_adapter.BaseAdapter]] .. py:attribute:: _source_config .. py:attribute:: _adapters :type: Dict[str, cryptodatapy.extract.adapters.base_adapter.BaseAdapter] .. py:method:: _get_adapter(source_name: str) -> cryptodatapy.extract.adapters.base_adapter.BaseAdapter Retrieves an instantiated adapter from the cache, or instantiates and caches it if missing. This handles lazy loading and passing the correct, vendor-specific configuration. :param source_name: The name of the data source/vendor (e.g., 'defillama', 'coinmetrics', 'ccxt'). :type source_name: str .. py:method:: get_data(request: cryptodatapy.core.data_request.DataRequest) -> pandas.DataFrame Routes the standardized DataRequest to the correct data source adapter and returns the result. :param request: The standardized data request object containing all necessary parameters. :type request: DataRequest :returns: A DataFrame containing the requested time series data. :rtype: pd.DataFrame .. py:method:: get_assets_info(source_name: str, as_list: bool = False, **kwargs) -> Union[pandas.DataFrame, list] Delegates the request for canonical asset metadata to the specified data source adapter. :param source_name: The data source to use for fetching asset info. Default is 'defillama'. :type source_name: str :param as_list: If True, returns a list of asset identifiers instead of a DataFrame. :type as_list: bool :returns: A DataFrame containing asset metadata. :rtype: pd.DataFrame .. py:method:: get_markets_info(source_name: str, as_list: bool = False, **kwargs) -> Union[pandas.DataFrame, list] Delegates the request for market metadata to the specified data source adapter. :param source_name: The data source to use for fetching market info. Default is 'defillama'. :type source_name: str :param as_list: If True, returns a list of market identifiers instead of a DataFrame. :type as_list: bool :returns: A DataFrame containing market metadata. :rtype: pd.DataFrame .. py:method:: get_fields_info(source_name: str, as_list: bool = False, **kwargs) -> Union[pandas.DataFrame, list] Delegates the request for field (metric) definitions to the specified data source adapter. :param source_name: The data source to use for fetching field info. Default is 'defillama'. :type source_name: str :param as_list: If True, returns a list of field/metric names instead of a DataFrame. :type as_list: bool :returns: A DataFrame containing field/metric definitions. :rtype: pd.DataFrame