Get data¶
This section contains functions to retrieve specific datasets related to financial instruments transparency and regulation:
FITRS: Fetches the most recent aggregated trading data for various financial instruments, covering trading volumes, average trade sizes, and transaction numbers under the Financial Instruments Transparency System (FITRS).
SSR: Retrieves data on shares that are exempt from Short Selling Regulations (SSR), providing insights into the list of securities that are excluded from SSR restrictions.
Get last available FITRS data¶
- esma_data_py.EsmaDataLoader.load_latest_files(self, file_type: str = 'Full', vcap: bool = False, isin: Optional[List[str]] = [], cfi: str = 'E', eqt=True, update: bool = False)¶
Retrieves the latest full files from the ‘fitrs’ dataset, filtered by instrument type and optionally by CFI codes and ISINs.
- Args:
file_type (str): Type of the file to retrieve (e.g., ‘Full’). Defaults to ‘Full’. vcap (bool): A flag to filter by VCAP (default is False). isin (list of str, optional): A list of ISIN(s) to filter the files. If provided, only files containing these ISINs are included. cfi (str): CFI code(s) to filter the files. Must be one of ‘C’, ‘D’, ‘E’, ‘F’, ‘H’, ‘I’, ‘J’, ‘O’, ‘R’, ‘S’. Defaults to ‘E’. eqt (bool): Whether to consider only equity instruments (True) or non-equity instruments (False). Defaults to True. update (bool): Whether to force re-downloading the files. If True, it always fetches the latest version. Defaults to False.
- Returns:
pd.DataFrame: A DataFrame containing the concatenated data from all files that meet the specified criteria.
- Examples:
>>> # Example to get the latest full files for equity instruments with specific CFI codes: >>> files_df = EsmaDataLoader().load_latest_files()
Get data from specific link¶
- esma_data_py.EsmaDataLoader.download_file(self, url: str, update: bool = False) DataFrame¶
Downloads and parses a file into a DataFrame.
If update is True, it forces a re-download. If False, cached data is not used.
- Args:
url (str): The URL of the file to download. update (bool): Whether to force a re-download (default is False).
- Returns:
pd.DataFrame: The parsed data from the file.
- Examples:
>>> edl = EsmaDataLoader() >>> list_files = edl.load_mifid_file_list()`` >>> edl.download_and_parse_single_file('https://dvcap.esma.europa.eu/dvcap/DVCRES_20240508.zip')