ITR.data ======== .. py:module:: ITR.data .. autoapi-nested-parse:: This module contains classes that create connections to data providers. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/ITR/data/bloomberg/index /autoapi/ITR/data/cdp/index /autoapi/ITR/data/csv/index /autoapi/ITR/data/data_provider/index /autoapi/ITR/data/excel/index /autoapi/ITR/data/inmemory/index /autoapi/ITR/data/iss/index /autoapi/ITR/data/msci/index /autoapi/ITR/data/sbti/index /autoapi/ITR/data/trucost/index /autoapi/ITR/data/urgentem/index Classes ------- .. autoapisummary:: ITR.data.DataProvider ITR.data.CSVProvider ITR.data.ExcelProvider ITR.data.Bloomberg ITR.data.CDP ITR.data.ISS ITR.data.Trucost ITR.data.Urgentem Package Contents ---------------- .. py:class:: DataProvider(**kwargs) Bases: :py:obj:`abc.ABC` General data provider super class. .. py:method:: get_targets(company_ids: List[str]) -> List[ITR.interfaces.IDataProviderTarget] :abstractmethod: Get all relevant targets for a list of company ids (ISIN). This method should return a list of IDataProviderTarget instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the targets .. py:method:: get_company_data(company_ids: List[str]) -> List[ITR.interfaces.IDataProviderCompany] :abstractmethod: Get all relevant data for a list of company ids (ISIN). This method should return a list of IDataProviderCompany instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the company data .. py:method:: get_sbti_targets(companies: list) -> list :abstractmethod: For each of the companies, get the status of their target (Target set, Committed or No target) as it's known to the SBTi. :param companies: A list of companies. Each company should be a dict with a "company_name" and "company_id" field. :return: The original list, enriched with a field called "sbti_target_status" .. py:class:: CSVProvider(path: str, path_targets: str, encoding: str = 'utf-8') Bases: :py:obj:`ITR.data.data_provider.DataProvider` Data provider skeleton for CSV files. This class serves primarily for testing purposes only! :param config: A dictionary containing a "path" field that leads to the path of the CSV file .. py:attribute:: data :value: None .. py:attribute:: data_targets :value: None .. py:method:: get_targets(company_ids: list) -> List[ITR.interfaces.IDataProviderTarget] Get all relevant targets for a list of company ids (ISIN). This method should return a list of IDataProviderTarget instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the targets .. py:method:: _target_df_to_model(df_targets) transforms target Dataframe into list of IDataProviderTarget instances :param df_targets: pandas Dataframe with targets :return: A list containing the targets .. py:method:: get_company_data(company_ids: list) -> List[ITR.interfaces.IDataProviderCompany] Get all relevant data for a list of company ids (ISIN). This method should return a list of IDataProviderCompany instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the company data .. py:method:: get_sbti_targets(companies: list) -> list For each of the companies, get the status of their target (Target set, Committed or No target) as it's known to the SBTi. :param companies: A list of companies. Each company should be a dict with a "company_name" and "company_id" field. :return: The original list, enriched with a field called "sbti_target_status" .. py:class:: ExcelProvider(path: str, config: Type[ITR.configs.ColumnsConfig] = ColumnsConfig) Bases: :py:obj:`ITR.data.data_provider.DataProvider` Data provider skeleton for CSV files. This class serves primarily for testing purposes only! :param config: A dictionary containing a "path" field that leads to the path of the CSV file .. py:attribute:: data :value: None .. py:attribute:: c .. py:method:: _process_row(row) .. py:method:: get_targets(company_ids: List[str]) -> List[ITR.interfaces.IDataProviderTarget] Get all relevant targets for a list of company ids (ISIN). This method should return a list of IDataProviderTarget instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the targets .. py:method:: _target_df_to_model(df_targets) transforms target Dataframe into list of IDataProviderTarget instances :param df_targets: pandas Dataframe with targets :return: A list containing the targets .. py:method:: get_company_data(company_ids: List[str]) -> List[ITR.interfaces.IDataProviderCompany] Get all relevant data for a list of company ids (ISIN). This method should return a list of IDataProviderCompany instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the company data .. py:method:: get_sbti_targets(companies: list) -> list :abstractmethod: For each of the companies, get the status of their target (Target set, Committed or No target) as it's known to the SBTi. :param companies: A list of companies. Each company should be a dict with a "company_name" and "company_id" field. :return: The original list, enriched with a field called "sbti_target_status" .. py:class:: Bloomberg(**kwargs) Bases: :py:obj:`ITR.data.data_provider.DataProvider` Data provider skeleton for Bloomberg. .. py:method:: _request(endpoint: str, data: dict) -> Optional[object] Request data from the server. Note: This request does in no way reflect the actual implementation, this is only a stub to show what a potential API request COULD look like. :param endpoint: The endpoint of the API :param data: The data to send as a body :return: The returned data, None in case of an error. .. py:method:: get_targets(company_ids: List[str]) -> List[ITR.interfaces.IDataProviderTarget] :abstractmethod: Get all relevant targets for a list of company ids (ISIN). This method should return a list of IDataProviderTarget instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the targets .. py:method:: get_company_data(company_ids: List[str]) -> List[ITR.interfaces.IDataProviderCompany] :abstractmethod: Get all relevant data for a list of company ids (ISIN). This method should return a list of IDataProviderCompany instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the company data .. py:method:: get_sbti_targets(companies: list) -> list :abstractmethod: For each of the companies, get the status of their target (Target set, Committed or No target) as it's known to the SBTi. :param companies: A list of companies. Each company should be a dict with a "company_name" and "company_id" field. :return: The original list, enriched with a field called "sbti_target_status" .. py:class:: CDP(**kwargs) Bases: :py:obj:`ITR.data.data_provider.DataProvider` Data provider skeleton for CDP. .. py:method:: get_targets(company_ids: List[str]) -> List[ITR.interfaces.IDataProviderTarget] :abstractmethod: Get all relevant targets for a list of company ids (ISIN). This method should return a list of IDataProviderTarget instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the targets .. py:method:: get_company_data(company_ids: List[str]) -> List[ITR.interfaces.IDataProviderCompany] :abstractmethod: Get all relevant data for a list of company ids (ISIN). This method should return a list of IDataProviderCompany instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the company data .. py:method:: get_sbti_targets(companies: list) -> list :abstractmethod: For each of the companies, get the status of their target (Target set, Committed or No target) as it's known to the SBTi. :param companies: A list of companies. Each company should be a dict with a "company_name" and "company_id" field. :return: The original list, enriched with a field called "sbti_target_status" .. py:class:: ISS(**kwargs) Bases: :py:obj:`ITR.data.data_provider.DataProvider` Data provider skeleton for ISS. .. py:method:: get_targets(company_ids: List[str]) -> List[ITR.interfaces.IDataProviderTarget] :abstractmethod: Get all relevant targets for a list of company ids (ISIN). This method should return a list of IDataProviderTarget instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the targets .. py:method:: get_company_data(company_ids: List[str]) -> List[ITR.interfaces.IDataProviderCompany] :abstractmethod: Get all relevant data for a list of company ids (ISIN). This method should return a list of IDataProviderCompany instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the company data .. py:method:: get_sbti_targets(companies: list) -> list :abstractmethod: For each of the companies, get the status of their target (Target set, Committed or No target) as it's known to the SBTi. :param companies: A list of companies. Each company should be a dict with a "company_name" and "company_id" field. :return: The original list, enriched with a field called "sbti_target_status" .. py:class:: Trucost(**kwargs) Bases: :py:obj:`ITR.data.data_provider.DataProvider` Data provider skeleton for Trucost. .. py:method:: get_targets(company_ids: List[str]) -> List[ITR.interfaces.IDataProviderTarget] :abstractmethod: Get all relevant targets for a list of company ids (ISIN). This method should return a list of IDataProviderTarget instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the targets .. py:method:: get_company_data(company_ids: List[str]) -> List[ITR.interfaces.IDataProviderCompany] :abstractmethod: Get all relevant data for a list of company ids (ISIN). This method should return a list of IDataProviderCompany instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the company data .. py:method:: get_sbti_targets(companies: list) -> list :abstractmethod: For each of the companies, get the status of their target (Target set, Committed or No target) as it's known to the SBTi. :param companies: A list of companies. Each company should be a dict with a "company_name" and "company_id" field. :return: The original list, enriched with a field called "sbti_target_status" .. py:class:: Urgentem(**kwargs) Bases: :py:obj:`ITR.data.data_provider.DataProvider` Data provider skeleton for Urgentem. .. py:method:: get_targets(company_ids: List[str]) -> List[ITR.interfaces.IDataProviderTarget] :abstractmethod: Get all relevant targets for a list of company ids (ISIN). This method should return a list of IDataProviderTarget instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the targets .. py:method:: get_company_data(company_ids: List[str]) -> List[ITR.interfaces.IDataProviderCompany] :abstractmethod: Get all relevant data for a list of company ids (ISIN). This method should return a list of IDataProviderCompany instances. :param company_ids: A list of company IDs (ISINs) :return: A list containing the company data .. py:method:: get_sbti_targets(companies: list) -> list :abstractmethod: For each of the companies, get the status of their target (Target set, Committed or No target) as it's known to the SBTi. :return: The original list, enriched with a field called "sbti_target_status"