bblocks.import_tools.fao ======================== .. py:module:: bblocks.import_tools.fao Attributes ---------- .. autoapisummary:: bblocks.import_tools.fao.URL Functions --------- .. autoapisummary:: bblocks.import_tools.fao.__scrape_index_df bblocks.import_tools.fao.__clean_fao_food_price_index bblocks.import_tools.fao.get_fao_index Module Contents --------------- .. py:data:: URL :value: 'https://www.fao.org/worldfoodsituation/foodpricesindex/en/' .. py:function:: __scrape_index_df(url: str) -> pandas.DataFrame Parse FAO food price index page to retrieve _data csv url .. py:function:: __clean_fao_food_price_index(df: pandas.DataFrame) -> pandas.DataFrame Clean index dataframe .. py:function:: get_fao_index(local_path: str | pathlib.Path = BBPaths.imported_data / 'fao_index.csv', update: bool = False) -> pandas.DataFrame Get FAO food price index :param local_path: where the downloaded CSV will be stored :param update: if True, updates the _data from the FAO 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.