bblocks.import_tools.wfp ======================== .. py:module:: bblocks.import_tools.wfp Attributes ---------- .. autoapisummary:: bblocks.import_tools.wfp.COUNTRY_URL bblocks.import_tools.wfp.INFLATION_URL bblocks.import_tools.wfp.FOOD_URL bblocks.import_tools.wfp._AVAILABLE_INDICATORS Classes ------- .. autoapisummary:: bblocks.import_tools.wfp.WFPData Functions --------- .. autoapisummary:: bblocks.import_tools.wfp._get_country_codes bblocks.import_tools.wfp._read_wfp_country_codes bblocks.import_tools.wfp._get_inflation bblocks.import_tools.wfp._get_insufficient_food bblocks.import_tools.wfp._read_files bblocks.import_tools.wfp._read_insufficient_food bblocks.import_tools.wfp._read_inflation Module Contents --------------- .. py:data:: COUNTRY_URL :type: str :value: 'https://api.hungermapdata.org/covid/data' .. py:data:: INFLATION_URL :type: str :value: 'https://api.vam.wfp.org/dataviz/api/GetCsv?idx=71,116&iso3=' .. py:data:: FOOD_URL :type: str :value: 'https://5763353767114258.eu-central-1.fc.aliyuncs.com/2016-08-15/proxy/wfp-data-api.36/map-data/adm0/' .. py:function:: _get_country_codes() -> None Script to fetch the country codes used by WFP. Saved as a dataframe. .. py:function:: _read_wfp_country_codes() -> dict Returns a dictionary with the country codes used by WFP. .. py:function:: _get_inflation(country_iso: str) -> None Get inflation data from VAM for a single country based on iso code .. py:function:: _get_insufficient_food(code: int, iso: str) -> None Get food consumption data from WFP .. py:function:: _read_files(iso_code: str, file_name: str) -> pandas.DataFrame .. py:function:: _read_insufficient_food(iso_codes: list) -> pandas.DataFrame Read and merge the data for the given iso codes. .. py:function:: _read_inflation(iso_codes: list) -> pandas.DataFrame Read and merge the data for the given iso codes. .. py:data:: _AVAILABLE_INDICATORS :type: dict .. py:class:: WFPData Bases: :py:obj:`bblocks.import_tools.common.ImportData` Class to download and read WFP inflation and insufficient food data .. py:property:: available_indicators :type: KeysView View the available indicators from WFP .. py:method:: _country_codes() -> dict .. py:method:: load_data(indicator: str | list) -> None Load an indicator into the WFPData object .. py:method:: update_data(reload_data: bool = True) -> None Update the data for all the indicators currently loaded