Package: wbpy
wbpyA Python interface to the World Bank Indicators and Climate APIs.ReadthedocsGithub sourceWorld Bank API docsThe Indicators API lets you access a large number of world development
indicators - country data on education, environment, gender, health,
population, poverty, technology, and more.The Climate API lets you access modelled and historical data for
temperature and precipitation.Why use wbpy?Dataset models let you access processed data and associated metadata
in different formats.If you don’t want processed data objects, you can still access the
raw JSON response.Single method calls to do the equivalent of multiple API requests,
eg. wbpy handles the specific date pairs which would otherwise be
required for the Climate API.Works with both ISO 1366 alpha-2 and alpha-3 country codes (the web
APIs mostly just support alpha-3).Elsewhere, there is alsowbdata, a wrapper for the
Indicators API which supports Pandas structures and has some
command-line functionality.Installationpip install wbpy, or download the source code andpython setup.py install.Contributors@bcipolliupgraded wbpy to support
Python 3 and v2 of the world bank API.Development and maintenanceThis project was unmaintained for a couple of years, although was
updated in July 2020 to support Python 3 and to use the v2 endpoint of
the API, as v1 has not been supported for a while (thanks@bcipolli). Although I’m not actively
adding new features or looking for issues, I’m happy to accept
contributions, and to provide commit access if anybody wants to work on
the project.Indicators APIBasic useHere’s a small case where we already know what API codes to use:importwbpyfrompprintimportpprintapi=wbpy.IndicatorAPI()iso_country_codes=["GB","FR","JP"]total_population="SP.POP.TOTL"dataset=api.get_dataset(total_population,iso_country_codes,date="2010:2012")datasethttp://api.worldbank.org/v2/countries/GBR;FRA;JPN/indicators/SP.POP.TOTL?date=2010%3A2012&format=json&per_page=10000<wbpy.indicators.IndicatorDataset('SP.POP.TOTL', 'Population, total') with id: 140421139962456>TheIndicatorDatasetinstance contains the direct API response and
various metadata. Usedataset.as_dict()to return a tidy dictionary
of the data:dataset.as_dict(){'FR': {'2012': 65659809.0, '2011': 65342780.0, '2010': 65027507.0},
 'GB': {'2012': 63700215.0, '2011': 63258810.0, '2010': 62766365.0},
 'JP': {'2012': 127629000.0, '2011': 127833000.0, '2010': 128070000.0}}Some examples of the metadata available:dataset.api_url'http://api.worldbank.org/v2/countries/GBR;FRA;JPN/indicators/SP.POP.TOTL?date=2010%3A2012&format=json&per_page=10000'dataset.indicator_name'Population, total'dataset.indicator_topicshttp://api.worldbank.org/v2/indicator/SP.POP.TOTL?format=json&per_page=10000[{'id': '19', 'value': 'Climate Change'}, {'id': '8', 'value': 'Health '}]dataset.countries{'FR': 'France', 'GB': 'United Kingdom', 'JP': 'Japan'}If you want to create your own data structures, you can process the raw
API response:dataset.api_response[{'page': 1,
  'pages': 1,
  'per_page': 10000,
  'total': 9,
  'sourceid': '2',
  'lastupdated': '2020-07-01'},
 [{'indicator': {'id': 'SP.POP.TOTL', 'value': 'Population, total'},
   'country': {'id': 'FR', 'value': 'France'},
   'countryiso3code': 'FRA',
   'date': '2012',
   'value': 65659809,
   'unit': '',
   'obs_status': '',
   'decimal': 0},
  {'indicator': {'id': 'SP.POP.TOTL', 'value': 'Population, total'},
   'country': {'id': 'FR', 'value': 'France'},
   'countryiso3code': 'FRA',
   'date': '2011',
   'value': 65342780,
   'unit': '',
   'obs_status': '',
   'decimal': 0},
  {'indicator': {'id': 'SP.POP.TOTL', 'value': 'Population, total'},
   'country': {'id': 'FR', 'value': 'France'},
   'countryiso3code': 'FRA',
   'date': '2010',
   'value': 65027507,
   'unit': '',
   'obs_status': '',
   'decimal': 0},
  {'indicator': {'id': 'SP.POP.TOTL', 'value': 'Population, total'},
   'country': {'id': 'GB', 'value': 'United Kingdom'},
   'countryiso3code': 'GBR',
   'date': '2012',
   'value': 63700215,
   'unit': '',
   'obs_status': '',
   'decimal': 0},
  {'indicator': {'id': 'SP.POP.TOTL', 'value': 'Population, total'},
   'country': {'id': 'GB', 'value': 'United Kingdom'},
   'countryiso3code': 'GBR',
   'date': '2011',
   'value': 63258810,
   'unit': '',
   'obs_status': '',
   'decimal': 0},
  {'indicator': {'id': 'SP.POP.TOTL', 'value': 'Population, total'},
   'country': {'id': 'GB', 'value': 'United Kingdom'},
   'countryiso3code': 'GBR',
   'date': '2010',
   'value': 62766365,
   'unit': '',
   'obs_status': '',
   'decimal': 0},
  {'indicator': {'id': 'SP.POP.TOTL', 'value': 'Population, total'},
   'country': {'id': 'JP', 'value': 'Japan'},
   'countryiso3code': 'JPN',
   'date': '2012',
   'value': 127629000,
   'unit': '',
   'obs_status': '',
   'decimal': 0},
  {'indicator': {'id': 'SP.POP.TOTL', 'value': 'Population, total'},
   'country': {'id': 'JP', 'value': 'Japan'},
   'countryiso3code': 'JPN',
   'date': '2011',
   'value': 127833000,
   'unit': '',
   'obs_status': '',
   'decimal': 0},
  {'indicator': {'id': 'SP.POP.TOTL', 'value': 'Population, total'},
   'country': {'id': 'JP', 'value': 'Japan'},
   'countryiso3code': 'JPN',
   'date': '2010',
   'value': 128070000,
   'unit': '',
   'obs_status': '',
   'decimal': 0}]]Searching for indicatorsWe don’t always know what indicators we want to use, so we can search:population_indicators=api.get_indicators(search="population")len(population_indicators)http://api.worldbank.org/v2/indicator?format=json&per_page=100001591Ah. That’s not a very manageable number. The API returns over 8000
indicator codes, and lots of them have “population” in the title.
Luckily, most of those indicators don’t really have much data, so we can
forget about them. You can browse the indicators with the best data
coverage athttp://data.worldbank.org/indicator, and you can passcommon_only=Trueto throw away all indicators that aren’t included
on that page:population_indicators=api.get_indicators(search="population",common_only=True)print("There are now only%dindicators to browse."%len(population_indicators))http://api.worldbank.org/v2/indicator?format=json&per_page=10000There are now only 246 indicators to browse!We don’t want to print that many results in the documentation, so let’s
filter some more. The API query string parameters are directly mapped to
kwargs for each method. For theget_indicatorsmethod, this means we
can filter by topic or source:health_topic_id=8health_indicators=api.get_indicators(search="population",common_only=True,topic=health_topic_id)print("We've narrowed it down to%dindicators."%len(health_indicators))http://api.worldbank.org/v2/topic/8/indicator?format=json&per_page=10000We've narrowed it down to 109 indicators.Each indicator has a variety of metadata:pprint(list(health_indicators.items())[2])('SH.DYN.AIDS.FE.ZS',
 {'name': "Women's share of population ages 15+ living with HIV (%)",
  'source': {'id': '2', 'value': 'World Development Indicators'},
  'sourceNote': 'Prevalence of HIV is the percentage of people who are '
                'infected with HIV. Female rate is as a percentage of the '
                'total population ages 15+ who are living with HIV.',
  'sourceOrganization': 'UNAIDS estimates.',
  'topics': [{'id': '8', 'value': 'Health '}, {'id': '17', 'value': 'Gender'}],
  'unit': ''})That data might be useful, but it’s not very friendly if you just want
to grab some API codes. If that’s what you want, you can pass the
results to theprint_codesmethod:api.print_codes(api.get_indicators(search="tuberculosis"))http://api.worldbank.org/v2/indicator?format=json&per_page=10000SH.TBS.CURE.ZS                 Tuberculosis treatment success rate (% of new cases)
SH.TBS.DOTS                    Tuberculosis cases detected under DOTS (%)
SH.TBS.DTEC.ZS                 Tuberculosis case detection rate (%, all forms)
SH.TBS.INCD                    Incidence of tuberculosis (per 100,000 people)
SH.TBS.INCD.HG                 Incidence of tuberculosis, high uncertainty bound (per 100,000 people)
SH.TBS.INCD.LW                 Incidence of tuberculosis, low uncertainty bound (per 100,000 people)
SH.TBS.MORT                    Tuberculosis death rate (per 100,000 people)
SH.TBS.MORT.HG                 Deaths due to tuberculosis among HIV-negative people, high uncertainty bound (per 100,000 population)
SH.TBS.MORT.LW                 Deaths due to tuberculosis among HIV-negative people, low uncertainty bound (per 100,000 population)
SH.TBS.PREV                    Tuberculosis prevalence rate (per 1000,000 population, WHO)
SH.TBS.PREV.HG                 Tuberculosis prevalence rate, high uncertainty bound (per 1000,000 population, WHO)
SH.TBS.PREV.LW                 Tuberculosis prevalence rate, low uncertainty bound (per 1000,000 population, WHO)There areget_functions matching all API endpoints (countries,
regions, sources, etc.), and thesearchparameter andprint_codesmethod can be used on any of them. For example:countries=api.get_countries(search="united")api.print_codes(countries)http://api.worldbank.org/v2/country?format=json&per_page=10000AE                             United Arab Emirates
GB                             United Kingdom
US                             United StatesMore searchingIf you’re not sure what to search for, just leave out thesearchparameter. By default, theget_methods return all API results:all_regions=api.get_regions()all_sources=api.get_sources()print("There are%dregions and%dsources."%(len(all_regions),len(all_sources)))http://api.worldbank.org/v2/region?format=json&per_page=10000http://api.worldbank.org/v2/source?format=json&per_page=10000There are 48 regions and 61 sources.Thesearchparameter actually just calls asearch_resultsmethod, which you can use directly:pprint(api.search_results("debt",all_sources)){'20': {'code': 'PSD',
        'concepts': '3',
        'dataavailability': 'Y',
        'description': '',
        'lastupdated': '2020-07-07',
        'metadataavailability': 'Y',
        'name': 'Quarterly Public Sector Debt',
        'url': ''},
 '22': {'code': 'QDS',
        'concepts': '3',
        'dataavailability': 'Y',
        'description': '',
        'lastupdated': '2020-04-30',
        'metadataavailability': 'Y',
        'name': 'Quarterly External Debt Statistics SDDS',
        'url': ''},
 '23': {'code': 'QDG',
        'concepts': '3',
        'dataavailability': 'Y',
        'description': '',
        'lastupdated': '2020-04-30',
        'metadataavailability': 'Y',
        'name': 'Quarterly External Debt Statistics GDDS',
        'url': ''},
 '54': {'code': 'JED',
        'concepts': '3',
        'dataavailability': 'Y',
        'description': '',
        'lastupdated': '2020-06-04',
        'metadataavailability': '',
        'name': 'Joint External Debt Hub',
        'url': ''},
 '6': {'code': 'IDS',
       'concepts': '3',
       'dataavailability': 'Y',
       'description': '',
       'lastupdated': '2019-12-02',
       'metadataavailability': 'Y',
       'name': 'International Debt Statistics',
       'url': ''}}By default, thesearchparameter only searches the title of an
entity (eg. a country name, or source title). If you want to search all
fields, set thesearch_fullflag toTrue:narrow_matches=api.get_topics(search="poverty")wide_matches=api.get_topics(search="poverty",search_full=True)print("%dtopic(s) match(es) 'poverty' in the title field, and%dtopics match 'poverty' in all fields."%(len(narrow_matches),len(wide_matches)))http://api.worldbank.org/v2/topic?format=json&per_page=10000http://api.worldbank.org/v2/topic?format=json&per_page=100001 topic(s) match(es) 'poverty' in the title field, and 8 topics match 'poverty' in all fields.API optionsAll endpoint query string parameters are directly mapped to method
kwargs. Different kwargs are available for eachget_method
(documented in the method’s docstring).language:EN,ES,FR,ARorZH. Non-English
languages seem to have less info in the responses.date:String formats -2001,2001:2006,2003M01:2004M06,2005Q2:2005Q4. Replace the years with your
own. Not all indicators have monthly or quarterly data.mrv:Most recent value, ie.mrv=3returns the three most
recent values for an indicator.gapfill:YorN. If using an MRV value, fills missing
values with the next available value (I think tracking back as far as
the MRV value allows). Defaults toN.frequency:Works with MRV, can specify quarterly (Q), monthly
(M) or yearly (Y). Not all indicators have monthly and
quarterly data.source:ID number to filter indicators by data source.topic:ID number to filter indicators by their assigned category.
Cannot give both source and topic in the same request.incomelevel:List of 3-letter IDs to filter results by income
level category.lendingtype:List of 3-letter IDs to filter results by lending
type.region:List of 3-letter IDs to filter results by region.If no date or MRV value is given,MRV defaults to 1, returning the
most recent value.Any given kwarg that is not in the above list will be directly added to
the query string, eg.foo="bar"will add&foo=barto the URL.Country codeswbpysupports ISO 1366 alpha-2 and alpha-3 country codes. The World
Bank uses some non-ISO 2-letter and 3-letter codes for regions, which
are also supported. You can access them via theNON_STANDARD_REGIONSattribute, which returns a dictionary of codes and region info. Again,
to see the codes, pass the dictionary to theprint_codesmethod:api.print_codes(api.NON_STANDARD_REGIONS)1A                             Arab World
1W                             World
4E                             East Asia & Pacific (developing only)
7E                             Europe & Central Asia (developing only)
8S                             South Asia
A4                             Sub-Saharan Africa excluding South Africa
A5                             Sub-Saharan Africa excluding South Africa and Nigeria
A9                             Africa
C4                             East Asia and the Pacific (IFC classification)
C5                             Europe and Central Asia (IFC classification)
C6                             Latin America and the Caribbean (IFC classification)
C7                             Middle East and North Africa (IFC classification)
C8                             South Asia (IFC classification)
C9                             Sub-Saharan Africa (IFC classification)
EU                             European Union
JG                             Channel Islands
KV                             Kosovo
M2                             North Africa
OE                             OECD members
S1                             Small states
S2                             Pacific island small states
S3                             Caribbean small states
S4                             Other small states
XC                             Euro area
XD                             High income
XE                             Heavily indebted poor countries (HIPC)
XJ                             Latin America & Caribbean (developing only)
XL                             Least developed countries: UN classification
XM                             Low income
XN                             Lower middle income
XO                             Low & middle income
XP                             Middle income
XQ                             Middle East & North Africa (developing only)
XR                             High income: nonOECD
XS                             High income: OECD
XT                             Upper middle income
XU                             North America
XY                             Not classified
Z4                             East Asia & Pacific (all income levels)
Z7                             Europe & Central Asia (all income levels)
ZF                             Sub-Saharan Africa (developing only)
ZG                             Sub-Saharan Africa (all income levels)
ZJ                             Latin America & Caribbean (all income levels)
ZQ                             Middle East & North Africa (all income levels)Climate APIThere are two methods to the climate API -get_modelled, which
returns aModelledDatasetinstance, andget_instrumental, which
returns anInstrumentalDatasetinstance. The World Bank API has
multiple date pairs associated with each dataset, but a singlewbpycall will make multiple API calls and return all the dates associated
with the requested data type.For full explanation of the data and associated models, see theClimate
API
documentation.Like the Indicators API, locations can be ISO-1366 alpha-2 or alpha-3
country codes. They can also be IDs corresponding to regional river
basins. A basin map can be found in the official Climate API
documentation. The API includes a KML interface that returns basin
definitions, but this is currently not supported bywbpy.Instrumental dataThe available arguments and their definitions are accessible via theARG_DEFINITIONSattribute:c_api=wbpy.ClimateAPI()c_api.ARG_DEFINITIONS["instrumental_types"]{'pr': 'Precipitation (rainfall and assumed water equivalent), in millimeters',
 'tas': 'Temperature, in degrees Celsius'}c_api.ARG_DEFINITIONS["instrumental_intervals"]['year', 'month', 'decade']iso_and_basin_codes=["AU",1,302]dataset=c_api.get_instrumental(data_type="tas",interval="decade",locations=iso_and_basin_codes)dataset<wbpy.climate.InstrumentalDataset({'tas': 'Temperature, in degrees Celsius'}, 'decade') with id: 140420664386392>TheInstrumentalDatasetinstance stores the API responses, various
metadata and methods for accessing the data:pprint(dataset.as_dict()){'1': {'1960': 5.975941,
       '1970': 6.1606956,
       '1980': 6.3607564,
       '1990': 6.600332,
       '2000': 7.3054743},
 '302': {'1960': -12.850627,
         '1970': -12.679074,
         '1980': -12.295782,
         '1990': -11.440549,
         '2000': -11.460049},
 'AU': {'1900': 21.078014,
        '1910': 21.296726,
        '1920': 21.158426,
        '1930': 21.245909,
        '1940': 21.04456,
        '1950': 21.136906,
        '1960': 21.263151,
        '1970': 21.306032,
        '1980': 21.633171,
        '1990': 21.727072,
        '2000': 21.741446,
        '2010': 21.351604}}dataset.data_type{'tas': 'Temperature, in degrees Celsius'}Modelled dataget_modelledreturns data derived from Global Glimate Models. There
are various possible data types:c_api.ARG_DEFINITIONS["modelled_types"]{'tmin_means': 'Average daily minimum temperature, Celsius',
 'tmax_means': 'Average daily maximum temperature, Celsius',
 'tmax_days90th': "Number of days with max temperature above the control period's 90th percentile (hot days)",
 'tmin_days90th': "Number of days with min temperature above the control period's 90th percentile (warm nights)",
 'tmax_days10th': "Number of days with max temperature below the control period's 10th percentile (cool days)",
 'tmin_days10th': "Number of days with min temperature below the control period's 10th percentile (cold nights)",
 'tmin_days0': 'Number of days with min temperature below 0 degrees Celsius',
 'ppt_days': 'Number of days with precipitation > 0.2mm',
 'ppt_days2': 'Number of days with precipitation > 2mm',
 'ppt_days10': 'Number of days with precipitation > 10mm',
 'ppt_days90th': "Number of days with precipitation > the control period's 90th percentile",
 'ppt_dryspell': 'Average number of days between precipitation events',
 'ppt_means': 'Average daily precipitation',
 'pr': 'Precipitation (rainfall and assumed water equivalent), in millimeters',
 'tas': 'Temperature, in degrees Celsius'}c_api.ARG_DEFINITIONS["modelled_intervals"]{'mavg': 'Monthly average',
 'annualavg': 'Annual average',
 'manom': 'Average monthly change (anomaly).',
 'annualanom': 'Average annual change (anomaly).',
 'aanom': 'Average annual change (anomaly).',
 'aavg': 'Annual average'}locations=["US"]modelled_dataset=c_api.get_modelled("pr","aavg",locations)modelled_dataset<wbpy.climate.ModelledDataset({'pr': 'Precipitation (rainfall and assumed water equivalent), in millimeters'}, {'annualavg': 'Annual average'}) with id: 140420644546936>Theas_dict()method forModelledDatasettakes a kwarg to
specify the SRES used for future values. The API uses the A2 and B1
scenarios:pprint(modelled_dataset.as_dict(sres="a2")){'bccr_bcm2_0': {'US': {'1939': 790.6361028238144,
                        '1959': 780.0266445283039,
                        '1979': 782.7526463724754,
                        '1999': 785.2701232986692,
                        '2039': 783.1710625360416,
                        '2059': 804.3092939039038,
                        '2079': 804.6334514665734,
                        '2099': 859.8239942059615}},
 'cccma_cgcm3_1': {'US': {'1939': 739.3362184367556,
                          '1959': 746.2975320411192,
                          '1979': 739.4449188917432,
                          '1999': 777.7889471267924,
                          '2039': 808.1474524518724,
                          '2059': 817.1428223416907,
                          '2079': 841.7569757399672,
                          '2099': 871.6962130920673}},
 'cnrm_cm3': {'US': {'1939': 939.7243516499025,
                     '1959': 925.6653938577782,
                     '1979': 940.2236730711822,
                     '1999': 947.5967851291585,
                     '2039': 962.6036875622598,
                     '2059': 964.4556538112397,
                     '2079': 970.7166949721155,
                     '2099': 987.7517843651068}},
 'csiro_mk3_5': {'US': {'1939': 779.0404023054358,
                        '1959': 799.5361627973773,
                        '1979': 796.607564873811,
                        '1999': 798.381580457504,
                        '2039': 843.0498166357976,
                        '2059': 867.6557574566958,
                        '2079': 884.6635096827529,
                        '2099': 914.4892749739001}},
 'ensemble_10': {'US': {'1939': 666.6475434339079,
                        '1959': 665.7610790034265,
                        '1979': 667.1738791525539,
                        '1999': 670.415327533486,
                        '2039': 686.4924376146926,
                        '2059': 690.3005736391768,
                        '2079': 693.0003564697117,
                        '2099': 709.0425715268083}},
 'ensemble_50': {'US': {'1939': 850.8566502216561,
                        '1959': 851.1821259381916,
                        '1979': 852.9435213996902,
                        '1999': 855.0129391106861,
                        '2039': 873.0523341457085,
                        '2059': 880.9922361302446,
                        '2079': 892.9013887250998,
                        '2099': 916.5180306375303}},
 'ensemble_90': {'US': {'1939': 1020.5076048129349,
                        '1959': 1018.0491512612145,
                        '1979': 1020.2880850240846,
                        '1999': 1029.4064082957505,
                        '2039': 1048.7391596386938,
                        '2059': 1056.5504828474266,
                        '2079': 1067.6845781511777,
                        '2099': 1106.7227445303276}},
 'gfdl_cm2_0': {'US': {'1939': 898.1444407247458,
                       '1959': 890.578762482606,
                       '1979': 873.31199204601,
                       '1999': 890.4286021472773,
                       '2039': 884.667792836329,
                       '2059': 891.2301658572712,
                       '2079': 858.2037683045394,
                       '2099': 862.2664763719782}},
 'gfdl_cm2_1': {'US': {'1939': 847.0485774775588,
                       '1959': 832.6677468315708,
                       '1979': 840.3616008806812,
                       '1999': 827.3124179982142,
                       '2039': 854.7964182636986,
                       '2059': 870.5118615966802,
                       '2079': 868.5767216101426,
                       '2099': 878.4820392256858}},
 'ingv_echam4': {'US': {'1939': 845.4780955327558,
                        '1959': 845.2359494710544,
                        '1979': 852.7707911085288,
                        '1999': 851.9327652092476,
                        '2039': 866.0409073675132,
                        '2059': 872.7481665480419,
                        '2079': 900.9028488881945,
                        '2099': 919.2062848249728}},
 'inmcm3_0': {'US': {'1939': 825.6505057699028,
                     '1959': 844.9800055068362,
                     '1979': 860.5045147370352,
                     '1999': 843.0909232427455,
                     '2039': 877.4836079129254,
                     '2059': 885.5902710722888,
                     '2079': 878.6926405756873,
                     '2099': 895.3363280260298}},
 'ipsl_cm4': {'US': {'1939': 897.1020362453344,
                     '1959': 881.2890852171191,
                     '1979': 888.57049309408,
                     '1999': 900.6203651333254,
                     '2039': 911.0684866203087,
                     '2059': 908.9880107774133,
                     '2079': 901.9352518210636,
                     '2099': 924.6232749957305}},
 'miroc3_2_medres': {'US': {'1939': 815.9899280956733,
                            '1959': 820.924517871823,
                            '1979': 820.561522790526,
                            '1999': 819.1997264378206,
                            '2039': 815.5123964532938,
                            '2059': 812.3150259004544,
                            '2079': 810.515112232343,
                            '2099': 817.447065795786}},
 'miub_echo_g': {'US': {'1939': 815.7217424350092,
                        '1959': 819.1216945126766,
                        '1979': 816.4814506968534,
                        '1999': 836.9998036334464,
                        '2039': 841.4617194083404,
                        '2059': 847.7322521257802,
                        '2079': 880.5316551949228,
                        '2099': 920.7048218268357}},
 'mpi_echam5': {'US': {'1939': 932.4105818597735,
                       '1959': 930.0013750415483,
                       '1979': 921.4702739003415,
                       '1999': 941.6353488835641,
                       '2039': 969.6867904854836,
                       '2059': 990.3857663124111,
                       '2079': 1000.6110341746332,
                       '2099': 1080.5289311209049}},
 'mri_cgcm2_3_2a': {'US': {'1939': 728.5749928767182,
                           '1959': 720.3172590678807,
                           '1979': 732.943309679262,
                           '1999': 727.9981579483319,
                           '2039': 735.1725461582992,
                           '2059': 751.6773914898702,
                           '2079': 776.7754868580876,
                           '2099': 798.3133892715804}},
 'ukmo_hadcm3': {'US': {'1939': 839.9996105395489,
                        '1959': 849.9134671410114,
                        '1979': 851.505705112856,
                        '1999': 848.5821514937204,
                        '2039': 874.371671909573,
                        '2059': 877.512058895459,
                        '2079': 881.875457040721,
                        '2099': 927.3730832143624}},
 'ukmo_hadgem1': {'US': {'1939': 841.7922922262945,
                         '1959': 845.698748695459,
                         '1979': 834.3090961483945,
                         '1999': 831.8516144217097,
                         '2039': 866.4876927782285,
                         '2059': 864.5861500956854,
                         '2079': 882.1356350906877,
                         '2099': 907.0139017841842}}}Again, various metadata is available, for example:modelled_dataset.gcms{'bccr_bcm2_0': 'BCM 2.0',
 'cccma_cgcm3_1': 'CGCM 3.1 (T47)',
 'cnrm_cm3': 'CNRM CM3',
 'csiro_mk3_5': 'CSIRO Mark 3.5',
 'gfdl_cm2_0': 'GFDL CM2.0',
 'gfdl_cm2_1': 'GFDL CM2.1',
 'ingv_echam4': 'ECHAM 4.6',
 'inmcm3_0': 'INMCM3.0',
 'ipsl_cm4': 'IPSL-CM4',
 'miub_echo_g': 'ECHO-G',
 'mpi_echam5': 'ECHAM5/MPI-OM',
 'mri_cgcm2_3_2a': 'MRI-CGCM2.3.2',
 'ukmo_hadcm3': 'UKMO HadCM3',
 'ukmo_hadgem1': 'UKMO HadGEM1',
 'ensemble_90': '90th percentile values of all models together',
 'ensemble_10': '10th percentile values of all models together',
 'ensemble_50': '50th percentile values of all models together'}modelled_dataset.dates()[('1920', '1939'),
 ('1940', '1959'),
 ('1960', '1979'),
 ('1980', '1999'),
 ('2020', '2039'),
 ('2040', '2059'),
 ('2060', '2079'),
 ('2080', '2099')]CacheThe default cache function uses system temporary files. You can specify
your own. The function has to take a url, and return the corresponding
web page as a string.deffunc(url):# Basic function that doesn't do any cachingfromsix.moves.urllibimportrequestreturnrequest.urlopen(url).read()# Either pass it in on instantiation...ind_api=wbpy.IndicatorAPI(fetch=func)# ...or point api.fetch to it.climate_api=wbpy.ClimateAPI()climate_api.fetch=func