imf_reader.sdr.read_interest_rate

Module to read SDR interest and exchange rates from the IMF website

Attributes

BASE_URL

Functions

get_interest_rates_data()

Read the data from the IMF website

preprocess_data(df)

Preprocess the input DataFrame by splitting columns and setting headers.

_filter_data(→ pandas.DataFrame)

Filter the DataFrame to separate rows for dates and SDR interest rates.

_format_data(→ pandas.DataFrame)

Format the filtered DataFrame into a clean DataFrame with interest rates and dates.

clean_data(→ pandas.DataFrame)

Cleaning/parsing steps for the data. split tab separated value into separate columns, rename columns, assign types, and additional formatting

fetch_interest_rates(→ pandas.DataFrame)

Fetch the historic SDR interest rates from the IMF

Module Contents

imf_reader.sdr.read_interest_rate.BASE_URL: str = 'https://www.imf.org/external/np/fin/data/sdr_ir.aspx'
imf_reader.sdr.read_interest_rate.get_interest_rates_data()

Read the data from the IMF website

imf_reader.sdr.read_interest_rate.preprocess_data(df: pandas.DataFrame)

Preprocess the input DataFrame by splitting columns and setting headers.

imf_reader.sdr.read_interest_rate._filter_data(df: pandas.DataFrame) pandas.DataFrame

Filter the DataFrame to separate rows for dates and SDR interest rates.

imf_reader.sdr.read_interest_rate._format_data(df: pandas.DataFrame) pandas.DataFrame

Format the filtered DataFrame into a clean DataFrame with interest rates and dates.

imf_reader.sdr.read_interest_rate.clean_data(df: pandas.DataFrame) pandas.DataFrame

Cleaning/parsing steps for the data. split tab separated value into separate columns, rename columns, assign types, and additional formatting

imf_reader.sdr.read_interest_rate.fetch_interest_rates() pandas.DataFrame

Fetch the historic SDR interest rates from the IMF

The SDR interest rate is based on the sum of the multiplicative products in SDR terms of the currency amounts in the SDR valuation basket, the level of the interest rate on the financial instrument of each component currency in the basket, and the exchange rate of each currency against the SDR. The SDR interest rate for the current week is released on Sunday morning, Washington D.C. time.

Returns:

A DataFrame with the historical SDR interest rates