bblocks.import_tools.wfp

Attributes

COUNTRY_URL

INFLATION_URL

FOOD_URL

_AVAILABLE_INDICATORS

Classes

WFPData

Class to download and read WFP inflation and insufficient food data

Functions

_get_country_codes(→ None)

Script to fetch the country codes used by WFP. Saved as a dataframe.

_read_wfp_country_codes(→ dict)

Returns a dictionary with the country codes used by WFP.

_get_inflation(→ None)

Get inflation data from VAM for a single country based on iso code

_get_insufficient_food(→ None)

Get food consumption data from WFP

_read_files(→ pandas.DataFrame)

_read_insufficient_food(→ pandas.DataFrame)

Read and merge the data for the given iso codes.

_read_inflation(→ pandas.DataFrame)

Read and merge the data for the given iso codes.

Module Contents

bblocks.import_tools.wfp.COUNTRY_URL: str = 'https://api.hungermapdata.org/covid/data'
bblocks.import_tools.wfp.INFLATION_URL: str = 'https://api.vam.wfp.org/dataviz/api/GetCsv?idx=71,116&iso3='
bblocks.import_tools.wfp.FOOD_URL: str = 'https://5763353767114258.eu-central-1.fc.aliyuncs.com/2016-08-15/proxy/wfp-data-api.36/map-data/adm0/'
bblocks.import_tools.wfp._get_country_codes() None

Script to fetch the country codes used by WFP. Saved as a dataframe.

bblocks.import_tools.wfp._read_wfp_country_codes() dict

Returns a dictionary with the country codes used by WFP.

bblocks.import_tools.wfp._get_inflation(country_iso: str) None

Get inflation data from VAM for a single country based on iso code

bblocks.import_tools.wfp._get_insufficient_food(code: int, iso: str) None

Get food consumption data from WFP

bblocks.import_tools.wfp._read_files(iso_code: str, file_name: str) pandas.DataFrame
bblocks.import_tools.wfp._read_insufficient_food(iso_codes: list) pandas.DataFrame

Read and merge the data for the given iso codes.

bblocks.import_tools.wfp._read_inflation(iso_codes: list) pandas.DataFrame

Read and merge the data for the given iso codes.

bblocks.import_tools.wfp._AVAILABLE_INDICATORS: dict
class bblocks.import_tools.wfp.WFPData

Bases: bblocks.import_tools.common.ImportData

Class to download and read WFP inflation and insufficient food data

property available_indicators: KeysView

View the available indicators from WFP

_country_codes() dict
load_data(indicator: str | list) None

Load an indicator into the WFPData object

update_data(reload_data: bool = True) None

Update the data for all the indicators currently loaded