bblocks.import_tools.debt.common

Attributes

URL

Functions

__download_dsa_pdf(→ None)

Downloads dsa pdf to the file

__pdf_to_df(→ pandas.DataFrame)

Reads a pdf and returns a dataframe

__clean_dsa(→ pandas.DataFrame)

Clean dsa dataframe

get_dsa(→ pandas.DataFrame)

Extract DSA _data from the

Module Contents

bblocks.import_tools.debt.common.URL: str = 'https://www.imf.org/external/Pubs/ft/dsa/dsalist.pdf'
bblocks.import_tools.debt.common.__download_dsa_pdf(url: str, local_path: str) None

Downloads dsa pdf to the file

bblocks.import_tools.debt.common.__pdf_to_df(local_path: str) pandas.DataFrame

Reads a pdf and returns a dataframe

bblocks.import_tools.debt.common.__clean_dsa(df: pandas.DataFrame) pandas.DataFrame

Clean dsa dataframe

bblocks.import_tools.debt.common.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

Parameters:
  • local_path – where the downloaded PDF will be stored

  • update (bool) – 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.

Returns:

pandas dataframe with country, latest publication date, and risk of debt distress