{ "info": { "author": "Matthew Duck", "author_email": "matt@mattduck.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering" ], "description": "``(This file was built from an IPython Notebook. Download README.ipynb on Github to poke around.)``\n\nwbpy\n====\n\n\nA Python interface to the World Bank Indicators and Climate APIs.\n\n- `Readthedocs `_\n- `Github source `_\n- `World Bank API docs `_\n\nThe Indicators API lets you access a large number of world development\nindicators - country data on education, environment, gender, health,\npopulation, poverty, technology, etc.\n\nThe Climate API lets you access modelled and historical data for\ntemperature and precipitation.\n\nWhy use wbpy?\n-------------\n\n\n- Dataset models let you access processed data and associated metadata\n in different formats.\n- If you don't want processed data objects, you can still access the\n raw JSON response.\n- Single method calls to do the equivalent of multiple API requests,\n eg. wbpy handles the specific date pairs which would otherwise be\n required for the Climate API.\n- Works with both ISO 1366 alpha-2 and alpha-3 country codes (the web\n APIs mostly just support alpha-3).\n\nElsewhere, there is also\n`wbdata `_, a wrapper for the\nIndicators API which supports Pandas structures and has some\ncommand-line functionality.\n\nInstallation\n------------\n\n\n``pip install wbpy``, or download the source code and\n``python setup.py install``.\n\nIndicators API\n==============\n\n\nBasic use\n---------\n\n\nHere's a small case where we already know what API codes to use:\n\n.. code:: python\n\n import wbpy\n from pprint import pprint\n \n api = wbpy.IndicatorAPI()\n \n iso_country_codes = [\"GB\", \"FR\", \"JP\"]\n total_population = \"SP.POP.TOTL\"\n \n dataset = api.get_dataset(total_population, iso_country_codes, date=\"2010:2012\")\n dataset\n\n\n\n.. parsed-literal::\n\n \n\n\n\nThe ``IndicatorDataset`` instance contains the direct API response and\nvarious metadata. Use ``dataset.as_dict()`` to return a tidy dictionary\nof the data:\n\n.. code:: python\n\n dataset.as_dict()\n\n\n\n.. parsed-literal::\n\n {u'FR': {u'2010': 65031235.0, u'2011': 65371613.0, u'2012': 65696689.0},\n u'GB': {u'2010': 62271177.0, u'2011': 62752472.0, u'2012': 63227526.0},\n u'JP': {u'2010': 127450459.0, u'2011': 127817277.0, u'2012': 127561489.0}}\n\n\n\nSome examples of the metadata available:\n\n.. code:: python\n\n dataset.api_url\n\n\n\n.. parsed-literal::\n\n 'http://api.worldbank.org/countries/GBR;FRA;JPN/indicators/SP.POP.TOTL?date=2010%3A2012&format=json&per_page=10000'\n\n\n\n.. code:: python\n\n dataset.indicator_name\n\n\n\n.. parsed-literal::\n\n u'Population, total'\n\n\n\n.. code:: python\n\n dataset.indicator_topics\n\n\n\n.. parsed-literal::\n\n [{u'id': u'8', u'value': u'Health '},\n {u'id': u'19', u'value': u'Climate Change'}]\n\n\n\n.. code:: python\n\n dataset.countries\n\n\n\n.. parsed-literal::\n\n {u'FR': u'France', u'GB': u'United Kingdom', u'JP': u'Japan'}\n\n\n\nIf you want to create your own data structures, you can process the raw\nAPI response:\n\n.. code:: python\n\n dataset.api_response\n\n\n\n.. parsed-literal::\n\n [{u'page': 1, u'pages': 1, u'per_page': u'10000', u'total': 9},\n [{u'country': {u'id': u'FR', u'value': u'France'},\n u'date': u'2012',\n u'decimal': u'0',\n u'indicator': {u'id': u'SP.POP.TOTL', u'value': u'Population, total'},\n u'value': u'65696689'},\n {u'country': {u'id': u'FR', u'value': u'France'},\n u'date': u'2011',\n u'decimal': u'0',\n u'indicator': {u'id': u'SP.POP.TOTL', u'value': u'Population, total'},\n u'value': u'65371613'},\n {u'country': {u'id': u'FR', u'value': u'France'},\n u'date': u'2010',\n u'decimal': u'0',\n u'indicator': {u'id': u'SP.POP.TOTL', u'value': u'Population, total'},\n u'value': u'65031235'},\n {u'country': {u'id': u'GB', u'value': u'United Kingdom'},\n u'date': u'2012',\n u'decimal': u'0',\n u'indicator': {u'id': u'SP.POP.TOTL', u'value': u'Population, total'},\n u'value': u'63227526'},\n {u'country': {u'id': u'GB', u'value': u'United Kingdom'},\n u'date': u'2011',\n u'decimal': u'0',\n u'indicator': {u'id': u'SP.POP.TOTL', u'value': u'Population, total'},\n u'value': u'62752472'},\n {u'country': {u'id': u'GB', u'value': u'United Kingdom'},\n u'date': u'2010',\n u'decimal': u'0',\n u'indicator': {u'id': u'SP.POP.TOTL', u'value': u'Population, total'},\n u'value': u'62271177'},\n {u'country': {u'id': u'JP', u'value': u'Japan'},\n u'date': u'2012',\n u'decimal': u'0',\n u'indicator': {u'id': u'SP.POP.TOTL', u'value': u'Population, total'},\n u'value': u'127561489'},\n {u'country': {u'id': u'JP', u'value': u'Japan'},\n u'date': u'2011',\n u'decimal': u'0',\n u'indicator': {u'id': u'SP.POP.TOTL', u'value': u'Population, total'},\n u'value': u'127817277'},\n {u'country': {u'id': u'JP', u'value': u'Japan'},\n u'date': u'2010',\n u'decimal': u'0',\n u'indicator': {u'id': u'SP.POP.TOTL', u'value': u'Population, total'},\n u'value': u'127450459'}]]\n\n\n\nSearching for indicators\n------------------------\n\n\nWe don't always know what indicators we want to use, so we can search:\n\n.. code:: python\n\n population_indicators = api.get_indicators(search=\"population\")\n len(population_indicators)\n\n\n\n.. parsed-literal::\n\n 1180\n\n\n\nAh. That's not a very manageable number. The API returns over 8000\nindicator codes, and lots of them have \"population\" in the title.\nLuckily, most of those indicators don't really have much data, so we can\nforget about them. You can browse the indicators with the best data\ncoverage at http://data.worldbank.org/indicator, and you can pass\n``common_only=True`` to throw away all indicators that aren't included\non that page:\n\n.. code:: python\n\n population_indicators = api.get_indicators(search=\"population\", common_only=True)\n print \"There are now only %d indicators to browse!\" % len(population_indicators)\n\n.. parsed-literal::\n\n There are now only 61 indicators to browse!\n\n\nWe don't want to print that many results in the documentation, so let's\nfilter some more. The API query string parameters are directly mapped to\nkwargs for each method. For the ``get_indicators`` method, this means we\ncan filter by topic or source:\n\n.. code:: python\n\n health_topic_id = 8\n health_indicators = api.get_indicators(search=\"population\", common_only=True, topic=health_topic_id)\n print \"We've narrowed it down to %d indicators!\" % len(health_indicators)\n\n.. parsed-literal::\n\n We've narrowed it down to 18 indicators!\n\n\nEach indicator has a variety of metadata:\n\n.. code:: python\n\n pprint(health_indicators.items()[0])\n\n.. parsed-literal::\n\n (u'SN.ITK.DEFC.ZS',\n {u'name': u'Prevalence of undernourishment (% of population)',\n u'source': {u'id': u'2', u'value': u'World Development Indicators'},\n u'sourceNote': u'Population below minimum level of dietary energy consumption (also referred to as prevalence of undernourishment) shows the percentage of the population whose food intake is insufficient to meet dietary energy requirements continuously. Data showing as 2.5 signifies a prevalence of undernourishment below 2.5%.',\n u'sourceOrganization': u'Food and Agriculture Organization, The State of Food Insecurity in the World (http://www.fao.org/publications/sofi/food-security-indicators/en/).',\n u'topics': [{u'id': u'8', u'value': u'Health '}]})\n\n\nThat data might be useful, but it's not very friendly if you just want\nto grab some API codes. If that's what you want, you can pass the\nresults to the ``print_codes`` method:\n\n.. code:: python\n\n api.print_codes(health_indicators)\n\n.. parsed-literal::\n\n SH.CON.1524.FE.ZS Condom use, population ages 15-24, female (% of females ages 15-24)\n SH.CON.1524.MA.ZS Condom use, population ages 15-24, male (% of males ages 15-24)\n SH.DYN.AIDS.FE.ZS Women's share of population ages 15+ living with HIV (%)\n SH.DYN.AIDS.ZS Prevalence of HIV, total (% of population ages 15-49)\n SH.MLR.NETS.ZS Use of insecticide-treated bed nets (% of under-5 population)\n SH.STA.ACSN Improved sanitation facilities (% of population with access)\n SH.STA.ACSN.RU Improved sanitation facilities, rural (% of rural population with access)\n SH.STA.ACSN.UR Improved sanitation facilities, urban (% of urban population with access)\n SN.ITK.DEFC.ZS Prevalence of undernourishment (% of population)\n SP.POP.0014.TO.ZS Population ages 0-14 (% of total)\n SP.POP.65UP.TO.ZS Population ages 65 and above (% of total)\n SP.POP.1564.TO.ZS Population ages 15-64 (% of total)\n SP.POP.DPND Age dependency ratio (% of working-age population)\n SP.POP.DPND.OL Age dependency ratio, old (% of working-age population)\n SP.POP.DPND.YG Age dependency ratio, young (% of working-age population)\n SP.POP.GROW Population growth (annual %)\n SP.POP.TOTL Population, total\n SP.POP.TOTL.FE.ZS Population, female (% of total)\n\n\nThere are ``get_`` functions matching all API endpoints (countries,\nregions, sources, etc.), and the ``search`` parameter and\n``print_codes`` method can be used on any of them. For example:\n\n.. code:: python\n\n countries = api.get_countries(search=\"united\")\n api.print_codes(countries)\n\n.. parsed-literal::\n\n AE United Arab Emirates\n GB United Kingdom\n US United States\n\n\nMore searching\n--------------\n\n\nIf you're not sure what to search for, just leave out the ``search``\nparameter. By default, the ``get_`` methods return all API results:\n\n.. code:: python\n\n all_regions = api.get_regions()\n all_sources = api.get_sources()\n \n print \"There are %d regions and %d sources.\" % (len(all_regions), len(all_sources))\n\n.. parsed-literal::\n\n There are 32 regions and 28 sources.\n\n\nThe ``search`` parameter actually just calls a ``search_results``\nmethod, which you can use directly:\n\n.. code:: python\n\n pprint(api.search_results(\"debt\", all_sources))\n\n.. parsed-literal::\n\n {u'20': {u'description': u'', u'name': u'Public Sector Debt', u'url': u''},\n u'22': {u'description': u'',\n u'name': u'Quarterly External Debt Statistics (QEDS) - Special Data Dissemination Standard (SDDS)',\n u'url': u''},\n u'23': {u'description': u'',\n u'name': u'Quarterly External Debt Statistics (QEDS) - General Data Dissemination System (GDDS)',\n u'url': u''},\n u'6': {u'description': u'',\n u'name': u'International Debt Statistics',\n u'url': u''}}\n\n\nBy default, the ``search`` parameter only searches the title of an\nentity (eg. a country name, or source title). If you want to search all\nfields, set the ``search_full`` flag to ``True``:\n\n.. code:: python\n\n narrow_matches = api.get_topics(search=\"poverty\")\n wide_matches = api.get_topics(search=\"poverty\", search_full=True)\n \n print \"%d topic(s) match(es) 'poverty' in the title field, and %d topics match 'poverty' in all fields.\" % (len(narrow_matches), len(wide_matches))\n\n.. parsed-literal::\n\n 1 topic(s) match(es) 'poverty' in the title field, and 7 topics match 'poverty' in all fields.\n\n\nAPI options\n-----------\n\n\nAll endpoint query string parameters are directly mapped to method\nkwargs. Different kwargs are available for each ``get_`` method\n(documented in the method's docstring).\n\n- **language:** ``EN``, ``ES``, ``FR``, ``AR`` or ``ZH``. Non-English\n languages seem to have less info in the responses.\n\n- **date:** String formats - ``2001``, ``2001:2006``,\n ``2003M01:2004M06``, ``2005Q2:2005Q4``. Replace the years with your\n own. Not all indicators have monthly or quarterly data.\n\n- **mrv:** Most recent value, ie. ``mrv=3`` returns the three most\n recent values for an indicator.\n\n- **gapfill:** ``Y`` or ``N``. If using an MRV value, fills missing\n values with the next available value (I think tracking back as far as\n the MRV value allows). Defaults to ``N``.\n\n- **frequency:** Works with MRV, can specify quarterly (``Q``), monthly\n (``M``) or yearly (``Y``). Not all indicators have monthly and\n quarterly data.\n\n- **source:** ID number to filter indicators by data source.\n\n- **topic:** ID number to filter indicators by their assigned category.\n Cannot give both source and topic in the same request.\n\n- **incomelevel:** List of 3-letter IDs to filter results by income\n level category.\n\n- **lendingtype:** List of 3-letter IDs to filter results by lending\n type.\n\n- **region:** List of 3-letter IDs to filter results by region.\n\nIf no date or MRV value is given, **MRV defaults to 1**, returning the\nmost recent value.\n\nAny given kwarg that is not in the above list will be directly added to\nthe query string, eg. ``foo=\"bar\"`` will add ``&foo=bar`` to the URL.\n\nCountry codes\n-------------\n\n\n``wbpy`` supports ISO 1366 alpha-2 and alpha-3 country codes. The World\nBank uses some non-ISO 2-letter and 3-letter codes for regions, which\nare also supported. You can access them via the ``NON_STANDARD_REGIONS``\nattribute, which returns a dictionary of codes and region info. Again,\nto see the codes, pass the dictionary to the ``print_codes`` method:\n\n.. code:: python\n\n api.print_codes(api.NON_STANDARD_REGIONS)\n\n.. parsed-literal::\n\n 1A Arab World\n 1W World\n 4E East Asia & Pacific (developing only)\n 7E Europe & Central Asia (developing only)\n 8S South Asia\n A4 Sub-Saharan Africa excluding South Africa\n A5 Sub-Saharan Africa excluding South Africa and Nigeria\n A9 Africa\n C4 East Asia and the Pacific (IFC classification)\n C5 Europe and Central Asia (IFC classification)\n C6 Latin America and the Caribbean (IFC classification)\n C7 Middle East and North Africa (IFC classification)\n C8 South Asia (IFC classification)\n C9 Sub-Saharan Africa (IFC classification)\n EU European Union\n JG Channel Islands\n KV Kosovo\n M2 North Africa\n OE OECD members\n S1 Small states\n S2 Pacific island small states\n S3 Caribbean small states\n S4 Other small states\n XC Euro area\n XD High income\n XE Heavily indebted poor countries (HIPC)\n XJ Latin America & Caribbean (developing only)\n XL Least developed countries: UN classification\n XM Low income\n XN Lower middle income\n XO Low & middle income\n XP Middle income\n XQ Middle East & North Africa (developing only)\n XR High income: nonOECD\n XS High income: OECD\n XT Upper middle income\n XU North America\n XY Not classified\n Z4 East Asia & Pacific (all income levels)\n Z7 Europe & Central Asia (all income levels)\n ZF Sub-Saharan Africa (developing only)\n ZG Sub-Saharan Africa (all income levels)\n ZJ Latin America & Caribbean (all income levels)\n ZQ Middle East & North Africa (all income levels)\n\n\nClimate API\n===========\n\n\nThere are two methods to the climate API - ``get_modelled``, which\nreturns a ``ModelledDataset`` instance, and ``get_instrumental``, which\nreturns an ``InstrumentalDataset`` instance. The World Bank API has\nmultiple date pairs associated with each dataset, but a single ``wbpy``\ncall will make multiple API calls and return all the dates associated\nwith the requested data type.\n\nFor full explanation of the data and associated models, see the `Climate\nAPI\ndocumentation `_.\n\nLike the Indicators API, locations can be ISO-1366 alpha-2 or alpha-3\ncountry codes. They can also be IDs corresponding to regional river\nbasins. A basin map can be found in the official Climate API\ndocumentation. The API includes a KML interface that returns basin\ndefinitions, but this is currently not supported by ``wbpy``.\n\nInstrumental data\n-----------------\n\n\nThe available arguments and their definitions are accessible via the\n``ARG_DEFINITIONS`` attribute:\n\n.. code:: python\n\n c_api = wbpy.ClimateAPI()\n \n c_api.ARG_DEFINITIONS[\"instrumental_types\"]\n\n\n\n.. parsed-literal::\n\n {'pr': 'Precipitation (rainfall and assumed water equivalent), in millimeters',\n 'tas': 'Temperature, in degrees Celsius'}\n\n\n\n.. code:: python\n\n c_api.ARG_DEFINITIONS[\"instrumental_intervals\"]\n\n\n\n.. parsed-literal::\n\n ['year', 'month', 'decade']\n\n\n\n.. code:: python\n\n iso_and_basin_codes = [\"AU\", 1, 302]\n \n dataset = c_api.get_instrumental(data_type=\"tas\", interval=\"decade\", locations=iso_and_basin_codes)\n dataset\n\n\n\n.. parsed-literal::\n\n \n\n\n\nThe ``InstrumentalDataset`` instance stores the API responses, various\nmetadata and methods for accessing the data:\n\n.. code:: python\n\n pprint(dataset.as_dict())\n\n.. parsed-literal::\n\n {'1': {'1960': 5.975941,\n '1970': 6.1606956,\n '1980': 6.3607564,\n '1990': 6.600332,\n '2000': 7.3054743},\n '302': {'1960': -12.850627,\n '1970': -12.679074,\n '1980': -12.295782,\n '1990': -11.440549,\n '2000': -11.460049},\n u'AU': {'1900': 21.078014,\n '1910': 21.296726,\n '1920': 21.158426,\n '1930': 21.245909,\n '1940': 21.04456,\n '1950': 21.136906,\n '1960': 21.263151,\n '1970': 21.306032,\n '1980': 21.633171,\n '1990': 21.727072,\n '2000': 21.741446}}\n\n\n.. code:: python\n\n dataset.data_type\n\n\n\n.. parsed-literal::\n\n {'tas': 'Temperature, in degrees Celsius'}\n\n\n\nModelled data\n-------------\n\n\n``get_modelled`` returns data derived from Global Glimate Models. There\nare various possible data types:\n\n.. code:: python\n\n c_api.ARG_DEFINITIONS[\"modelled_types\"]\n\n\n\n.. parsed-literal::\n\n {'ppt_days': 'Number of days with precipitation > 0.2mm',\n 'ppt_days10': 'Number of days with precipitation > 10mm',\n 'ppt_days2': 'Number of days with precipitation > 2mm',\n 'ppt_days90th': \"Number of days with precipitation > the control period's 90th percentile\",\n 'ppt_dryspell': 'Average number of days between precipitation events',\n 'ppt_means': 'Average daily precipitation',\n 'pr': 'Precipitation (rainfall and assumed water equivalent), in millimeters',\n 'tas': 'Temperature, in degrees Celsius',\n 'tmax_days10th': \"Number of days with max temperature below the control period's 10th percentile (cool days)\",\n 'tmax_days90th': \"Number of days with max temperature above the control period's 90th percentile (hot days)\",\n 'tmax_means': 'Average daily maximum temperature, Celsius',\n 'tmin_days0': 'Number of days with min temperature below 0 degrees Celsius',\n 'tmin_days10th': \"Number of days with min temperature below the control period's 10th percentile (cold nights)\",\n 'tmin_days90th': \"Number of days with min temperature above the control period's 90th percentile (warm nights)\",\n 'tmin_means': 'Average daily minimum temperature, Celsius'}\n\n\n\n.. code:: python\n\n c_api.ARG_DEFINITIONS[\"modelled_intervals\"]\n\n\n\n.. parsed-literal::\n\n {'aanom': 'Average annual change (anomaly).',\n 'aavg': 'Annual average',\n 'annualanom': 'Average annual change (anomaly).',\n 'annualavg': 'Annual average',\n 'manom': 'Average monthly change (anomaly).',\n 'mavg': 'Monthly average'}\n\n\n\n.. code:: python\n\n locations = [\"US\"]\n modelled_dataset = c_api.get_modelled(\"pr\", \"aavg\", locations)\n modelled_dataset\n\n\n\n.. parsed-literal::\n\n \n\n\n\nThe ``as_dict()`` method for ``ModelledDataset`` takes a kwarg to\nspecify the SRES used for future values. The API uses the A2 and B1\nscenarios:\n\n.. code:: python\n\n pprint(modelled_dataset.as_dict(sres=\"a2\"))\n\n.. parsed-literal::\n\n {u'bccr_bcm2_0': {u'US': {'1939': 790.6361028238144,\n '1959': 780.0266445283039,\n '1979': 782.7526463724754,\n '1999': 785.2701232986692,\n '2039': 783.1710625360416,\n '2059': 804.3092939039038,\n '2079': 804.6334514665734,\n '2099': 859.8239942059615}},\n u'cccma_cgcm3_1': {u'US': {'1939': 739.3362184367556,\n '1959': 746.2975320411192,\n '1979': 739.4449188917432,\n '1999': 777.7889471267924,\n '2039': 808.1474524518724,\n '2059': 817.1428223416907,\n '2079': 841.7569757399672,\n '2099': 871.6962130920673}},\n u'cnrm_cm3': {u'US': {'1939': 939.7243516499025,\n '1959': 925.6653938577782,\n '1979': 940.2236730711822,\n '1999': 947.5967851291585,\n '2039': 962.6036875622598,\n '2059': 964.4556538112397,\n '2079': 970.7166949721155,\n '2099': 987.7517843651068}},\n u'csiro_mk3_5': {u'US': {'1939': 779.0404023054358,\n '1959': 799.5361627973773,\n '1979': 796.607564873811,\n '1999': 798.381580457504,\n '2039': 843.0498166357976,\n '2059': 867.6557574566958,\n '2079': 884.6635096827529,\n '2099': 914.4892749739001}},\n 'ensemble_10': {u'US': {'1939': 666.6475434339079,\n '1959': 665.7610790034265,\n '1979': 667.1738791525539,\n '1999': 670.415327533486,\n '2039': 686.4924376146926,\n '2059': 690.3005736391768,\n '2079': 693.0003564697117,\n '2099': 709.0425715268083}},\n 'ensemble_50': {u'US': {'1939': 850.8566502216561,\n '1959': 851.1821259381916,\n '1979': 852.9435213996902,\n '1999': 855.0129391106861,\n '2039': 873.0523341457085,\n '2059': 880.9922361302446,\n '2079': 892.9013887250998,\n '2099': 916.5180306375303}},\n 'ensemble_90': {u'US': {'1939': 1020.5076048129349,\n '1959': 1018.0491512612145,\n '1979': 1020.2880850240846,\n '1999': 1029.4064082957505,\n '2039': 1048.7391596386938,\n '2059': 1056.5504828474266,\n '2079': 1067.6845781511777,\n '2099': 1106.7227445303276}},\n u'gfdl_cm2_0': {u'US': {'1939': 898.1444407247458,\n '1959': 890.578762482606,\n '1979': 873.31199204601,\n '1999': 890.4286021472773,\n '2039': 884.667792836329,\n '2059': 891.2301658572712,\n '2079': 858.2037683045394,\n '2099': 862.2664763719782}},\n u'gfdl_cm2_1': {u'US': {'1939': 847.0485774775588,\n '1959': 832.6677468315708,\n '1979': 840.3616008806812,\n '1999': 827.3124179982142,\n '2039': 854.7964182636986,\n '2059': 870.5118615966802,\n '2079': 868.5767216101426,\n '2099': 878.4820392256858}},\n u'ingv_echam4': {u'US': {'1939': 845.4780955327558,\n '1959': 845.2359494710544,\n '1979': 852.7707911085288,\n '1999': 851.9327652092476,\n '2039': 866.0409073675132,\n '2059': 872.7481665480419,\n '2079': 900.9028488881945,\n '2099': 919.2062848249728}},\n u'inmcm3_0': {u'US': {'1939': 825.6505057699028,\n '1959': 844.9800055068362,\n '1979': 860.5045147370352,\n '1999': 843.0909232427455,\n '2039': 877.4836079129254,\n '2059': 885.5902710722888,\n '2079': 878.6926405756873,\n '2099': 895.3363280260298}},\n u'ipsl_cm4': {u'US': {'1939': 897.1020362453344,\n '1959': 881.2890852171191,\n '1979': 888.57049309408,\n '1999': 900.6203651333254,\n '2039': 911.0684866203087,\n '2059': 908.9880107774133,\n '2079': 901.9352518210636,\n '2099': 924.6232749957305}},\n u'miroc3_2_medres': {u'US': {'1939': 815.9899280956733,\n '1959': 820.924517871823,\n '1979': 820.561522790526,\n '1999': 819.1997264378206,\n '2039': 815.5123964532938,\n '2059': 812.3150259004544,\n '2079': 810.515112232343,\n '2099': 817.447065795786}},\n u'miub_echo_g': {u'US': {'1939': 815.7217424350092,\n '1959': 819.1216945126766,\n '1979': 816.4814506968534,\n '1999': 836.9998036334464,\n '2039': 841.4617194083404,\n '2059': 847.7322521257802,\n '2079': 880.5316551949228,\n '2099': 920.7048218268357}},\n u'mpi_echam5': {u'US': {'1939': 932.4105818597735,\n '1959': 930.0013750415483,\n '1979': 921.4702739003415,\n '1999': 941.6353488835641,\n '2039': 969.6867904854836,\n '2059': 990.3857663124111,\n '2079': 1000.6110341746332,\n '2099': 1080.5289311209049}},\n u'mri_cgcm2_3_2a': {u'US': {'1939': 728.5749928767182,\n '1959': 720.3172590678807,\n '1979': 732.943309679262,\n '1999': 727.9981579483319,\n '2039': 735.1725461582992,\n '2059': 751.6773914898702,\n '2079': 776.7754868580876,\n '2099': 798.3133892715804}},\n u'ukmo_hadcm3': {u'US': {'1939': 839.9996105395489,\n '1959': 849.9134671410114,\n '1979': 851.505705112856,\n '1999': 848.5821514937204,\n '2039': 874.371671909573,\n '2059': 877.512058895459,\n '2079': 881.875457040721,\n '2099': 927.3730832143624}},\n u'ukmo_hadgem1': {u'US': {'1939': 841.7922922262945,\n '1959': 845.698748695459,\n '1979': 834.3090961483945,\n '1999': 831.8516144217097,\n '2039': 866.4876927782285,\n '2059': 864.5861500956854,\n '2079': 882.1356350906877,\n '2099': 907.0139017841842}}}\n\n\nAgain, various metadata is available, for example:\n\n.. code:: python\n\n modelled_dataset.gcms\n\n\n\n.. parsed-literal::\n\n {u'bccr_bcm2_0': 'BCM 2.0',\n u'cccma_cgcm3_1': 'CGCM 3.1 (T47)',\n u'cnrm_cm3': 'CNRM CM3',\n u'csiro_mk3_5': 'CSIRO Mark 3.5',\n 'ensemble_10': '10th percentile values of all models together',\n 'ensemble_50': '50th percentile values of all models together',\n 'ensemble_90': '90th percentile values of all models together',\n u'gfdl_cm2_0': 'GFDL CM2.0',\n u'gfdl_cm2_1': 'GFDL CM2.1',\n u'ingv_echam4': 'ECHAM 4.6',\n u'inmcm3_0': 'INMCM3.0',\n u'ipsl_cm4': 'IPSL-CM4',\n u'miub_echo_g': 'ECHO-G',\n u'mpi_echam5': 'ECHAM5/MPI-OM',\n u'mri_cgcm2_3_2a': 'MRI-CGCM2.3.2',\n u'ukmo_hadcm3': 'UKMO HadCM3',\n u'ukmo_hadgem1': 'UKMO HadGEM1'}\n\n\n\n.. code:: python\n\n modelled_dataset.dates()\n\n\n\n.. parsed-literal::\n\n [('1920', '1939'),\n ('1940', '1959'),\n ('1960', '1979'),\n ('1980', '1999'),\n ('2020', '2039'),\n ('2040', '2059'),\n ('2060', '2079'),\n ('2080', '2099')]\n\n\n\nCache\n=====\n\n\nThe default cache function uses system temporary files. You can specify\nyour own. The function has to take a url, and return the corresponding\nweb page as a string.\n\n.. code:: python\n\n def func(url):\n # Basic function that doesn't do any caching\n import urllib2\n return urllib2.urlopen(url).read()\n \n # Either pass it in on instantiation...\n ind_api = wbpy.IndicatorAPI(fetch=func)\n \n # ...or point api.fetch to it. \n climate_api = wbpy.ClimateAPI()\n climate_api.fetch = func", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mattduck/wbpy", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "wbpy", "package_url": "https://pypi.org/project/wbpy/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/wbpy/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/mattduck/wbpy" }, "release_url": "https://pypi.org/project/wbpy/2.0.1/", "requires_dist": null, "requires_python": null, "summary": "A Python interface to the World Bank Indicators and Climate APIs", "version": "2.0.1" }, "last_serial": 905874, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "c5a6cff18cad4fb417f92c273d5aa3c5", "sha256": "e0b231f08fb147b7f9c4758e4977a6f3423cf94cd8767a4cdb93a05a200dd074" }, "downloads": -1, "filename": "wbpy-0.2.0.tar.gz", "has_sig": false, "md5_digest": "c5a6cff18cad4fb417f92c273d5aa3c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20111, "upload_time": "2013-04-18T22:48:21", "url": "https://files.pythonhosted.org/packages/07/6d/44ceee23d5710e46da039a620d49e545c5fb7c671ca11f44b90499da0a71/wbpy-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "bd0c778a0253133475038cf15dafd018", "sha256": "e9284b1899124388e4e20ad1b5ba75fb884eccfab100d68501be60e455315b03" }, "downloads": -1, "filename": "wbpy-0.2.1.tar.gz", "has_sig": false, "md5_digest": "bd0c778a0253133475038cf15dafd018", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29985, "upload_time": "2013-04-18T23:03:16", "url": "https://files.pythonhosted.org/packages/86/e0/03f23b8c471312caba9afa6e082df4842813320c15bb78a4f95cd3927979/wbpy-0.2.1.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "502219dec90acc82574542c0f13b89fb", "sha256": "c43cf4095a5f1c082d30e5fae14f104b00299988d6aa8895670a114787b74006" }, "downloads": -1, "filename": "wbpy-1.0.0.tar.gz", "has_sig": false, "md5_digest": "502219dec90acc82574542c0f13b89fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 120505, "upload_time": "2013-09-12T16:19:11", "url": "https://files.pythonhosted.org/packages/b1/50/358c2fc71e0deadca0198d66b3cc7163361898c16fec32c7aedf93de0782/wbpy-1.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "b69248a13dcc7fa7a2c13e1daae5ab0e", "sha256": "b6e8c2da3c133dff51d58f96a2c2d765796abe7ee838938d20060a3f57b3e1f5" }, "downloads": -1, "filename": "wbpy-2.0.1.tar.gz", "has_sig": false, "md5_digest": "b69248a13dcc7fa7a2c13e1daae5ab0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 65738, "upload_time": "2013-10-28T22:16:33", "url": "https://files.pythonhosted.org/packages/2e/a8/a1bf800c0829b5c080b987dc7efa8252ac70bd7197ad485d520cb3be8f12/wbpy-2.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b69248a13dcc7fa7a2c13e1daae5ab0e", "sha256": "b6e8c2da3c133dff51d58f96a2c2d765796abe7ee838938d20060a3f57b3e1f5" }, "downloads": -1, "filename": "wbpy-2.0.1.tar.gz", "has_sig": false, "md5_digest": "b69248a13dcc7fa7a2c13e1daae5ab0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 65738, "upload_time": "2013-10-28T22:16:33", "url": "https://files.pythonhosted.org/packages/2e/a8/a1bf800c0829b5c080b987dc7efa8252ac70bd7197ad485d520cb3be8f12/wbpy-2.0.1.tar.gz" } ] }