bblocks.import_tools.debt.common ================================ .. py:module:: bblocks.import_tools.debt.common Attributes ---------- .. autoapisummary:: bblocks.import_tools.debt.common.URL Functions --------- .. autoapisummary:: bblocks.import_tools.debt.common.__download_dsa_pdf bblocks.import_tools.debt.common.__pdf_to_df bblocks.import_tools.debt.common.__clean_dsa bblocks.import_tools.debt.common.get_dsa Module Contents --------------- .. py:data:: URL :type: str :value: 'https://www.imf.org/external/Pubs/ft/dsa/dsalist.pdf' .. py:function:: __download_dsa_pdf(url: str, local_path: str) -> None Downloads dsa pdf to the file .. py:function:: __pdf_to_df(local_path: str) -> pandas.DataFrame Reads a pdf and returns a dataframe .. py:function:: __clean_dsa(df: pandas.DataFrame) -> pandas.DataFrame Clean dsa dataframe .. py:function:: get_dsa(update=False, local_path: str = None) -> pandas.DataFrame Extract DSA _data from the Extract the most recent Debt Sustainability Assessment (DSA) _data for PRGT-Eligible Countries from the IMF website. URL = https://www.imf.org/external/Pubs/ft/dsa/DSAlist.pdf :param local_path: where the downloaded PDF will be stored :param update: if True, updates the _data from the IMF website. Otherwise it loads the _data from the local file. If a local file does not exist, the _data will be extracted from the website. :type update: bool :returns: pandas dataframe with country, latest publication date, and risk of debt distress