bblocks.import_tools.debt.get_data ================================== .. py:module:: bblocks.import_tools.debt.get_data .. autoapi-nested-parse:: Helper functions to generate the URL and extract the data from the IDS database. Functions --------- .. autoapisummary:: bblocks.import_tools.debt.get_data._time_period bblocks.import_tools.debt.get_data._country_list bblocks.import_tools.debt.get_data._api_url bblocks.import_tools.debt.get_data._clean_ids_response bblocks.import_tools.debt.get_data.get_indicator_data Module Contents --------------- .. py:function:: _time_period(start_year: int, end_year: int) -> str Take a period range and convert it to an API compatible string .. py:function:: _country_list(countries: str | list) -> str Take a country list and convert it to an API compatible string .. py:function:: _api_url(indicator: str, countries: str | list, start_year: int, end_year: int, source: int) -> str Query string for API for IDS data. One indicator at a time .. py:function:: _clean_ids_response(data: pandas.DataFrame, indicator: str) -> pandas.DataFrame .. py:function:: get_indicator_data(indicator: str, countries: str | list = 'all', start_year: int = 2017, end_year: int = 2025, source: int = 6, try_again: bool = True) -> pandas.DataFrame Get data for a single indicator from the World Bank API :param indicator: The indicator to get data for :param countries: The countries to get data for. Defaults to all countries :param start_year: The start year for the data. Defaults to 2017 :param end_year: The end year for the data. Defaults to 2025 :param source: The source of the data. Defaults to 6 (IDS) :param try_again: Whether to try again if the API fails. Defaults to True :returns: A dataframe with the data