{ "info": { "author": "Marc Wouts", "author_email": "marc.wouts@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Framework :: Jupyter", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8" ], "description": "# The World Bank Data in Python\n\n[![Build Status](https://travis-ci.com/mwouts/world_bank_data.svg?branch=master)](https://travis-ci.com/mwouts/world_bank_data)\n[![codecov.io](https://codecov.io/github/mwouts/world_bank_data/coverage.svg?branch=master)](https://codecov.io/github/mwouts/world_bank_data?branch=master)\n[![Language grade: Python](https://img.shields.io/badge/lgtm-A+-brightgreen.svg)](https://lgtm.com/projects/g/mwouts/world_bank_data/context:python)\n[![Pypi](https://img.shields.io/pypi/v/world_bank_data.svg)](https://pypi.python.org/pypi/world_bank_data)\n[![pyversions](https://img.shields.io/pypi/pyversions/world_bank_data.svg)](https://pypi.python.org/pypi/world_bank_data)\n[![Jupyter Notebook](https://img.shields.io/badge/Binder-Notebook-blue.svg)](\n https://mybinder.org/v2/gh/mwouts/world_bank_data/master?filepath=examples%2FA%20sunburst%20plot%20of%20the%20world%20population.ipynb)\n[![JupyterLab](https://img.shields.io/badge/Binder-JupyterLab-blue.svg)](\n https://mybinder.org/v2/gh/mwouts/world_bank_data/master?urlpath=lab)\n\nThis is an implementation of the [World Bank API v2](https://datahelpdesk.worldbank.org/knowledgebase/articles/889386-developer-information-overview) in Python. Use this package to explore the [World Development Indicators](http://datatopics.worldbank.org/world-development-indicators/) published by the [World Bank](http://www.worldbank.org/).\n\n# Quick tutorial\n\n## Installation\n\nInstall or update the _World Bank Data_ python package with\n\n```bash\npip install world_bank_data --upgrade\n```\n\n## Get the list of sources, topics, countries, regions\n\n```python\nimport pandas as pd\nimport world_bank_data as wb\npd.set_option('display.max_rows', 6)\n```\n\nThe list of topics is available with\n\n```python\nwb.get_topics()\n```\n\nSources are returned by\n\n```python\nwb.get_sources()\n```\n\nAnd finally, the list of countries is accessible with\n\n```python\nwb.get_countries()\n```\n\nIn addition, give a try to\n- `get_regions`\n- `get_incomelevels`\n- `get_lendingtypes`\n\nto retrieve more information about country classifiers.\n\n## Get the list of indicators\n\nThis is done with the `get_indicators` function. You may query only the indicators for a specific source or topic as below. If you input no arguments, the `get_indicator` function will return the description of all the 16,000+ indicators. \n\n```python\nwb.get_indicators(topic=3, source=2) # topic and source id are from get_topics/get_sources\n```\n\nRequesting all indicators may take a few seconds, but no worries, the result is cached, so next time this will be instantaneous.\n\n## Searching for one country or indicator\n\nUse the functions `search_countries`, `search_source`, `search_indicators`. Or, if you want to search in a existing dataframe, simply use `search`.\n\n```python\nwb.search_indicators('mathematics')\n```\n\n## Get the values of an indicator\n\nThe function `get_series` returns the value of a single indicator. The World Bank API accepts quite a few arguments, including:\n- `mrv`, integer: one or more _most recent values_\n- `date`, string: either one year, or two years separated with a colon, like '2010:2018'\n- `gapfill`, string: 'Y' or 'N' (the default): forward fills missing values.\n\nFor instance, the call below returns the most recent estimate for the World Population:\n\n```python\nwb.get_series('SP.POP.TOTL', mrv=1)\n```\n\nThe result above has a 3-dimensional index. Use the argument `simplify_index` to ignore the dimensions that take a single value (here: `year` and `series`). Also, use the argument `id_or_value='id'` if you prefer your data to be indexed by the codes rather than labels:\n\n```python\nwb.get_series('SP.POP.TOTL', date='2016', id_or_value='id', simplify_index=True)\n```\n\n## Ready for an interative tutorial?\n\nGo to our [Binder](https://mybinder.org/v2/gh/mwouts/world_bank_data/master) and run either this [README](https://github.com/mwouts/world_bank_data/blob/master/README.md), or our other [tutorial](https://github.com/mwouts/world_bank_data/blob/master/examples/) with the code required to produce this plot of the World Population:\n\n[![World Population 2017](https://gist.githubusercontent.com/mwouts/ec3a88f1d97e36a062f69d4072b91e39/raw/79211a09957c6934fabf738a59c2c9b8df943696/world_population.gif)](https://nbviewer.jupyter.org/github/mwouts/world_bank_data/blob/master/examples/A%20sunburst%20plot%20of%20the%20world%20population.ipynb)\n\n# References\n\n## The World Bank\n\nThe [World Bank](https://www.worldbank.org/) has a [Data Catalog](https://datacatalog.worldbank.org/), and an interactive [data explorer](https://data.worldbank.org/indicator/sp.pop.totl).\n\nThird party applications that allow to access the data from various languages are listed [here](https://data.worldbank.org/products/third-party-apps).\n\n## Google's Public Data Explorer\n\nThe World Bank data is also available in Google's [Data Explorer](https://data.worldbank.org/products/third-party-apps).\n\n## Python\n\nAlternatively to `world_bank_data`, Python users may find useful the following packages:\n- [`wbpy`](https://github.com/mattduck/wbpy/blob/master/README.rst), nicely documented but last released in 2013.\n- [`wbdata`](https://github.com/oliversherouse/wbdata/blob/master/README.rst), which works well.\n- [`pandas_datareader`](https://pandas-datareader.readthedocs.io/en/latest/readers/world-bank.html)\n\nThe reason for which I wrote `world_bank_data` is mostly speed, e.g. I wanted to use the lastest version of the World Bank API (v2) and benefit from significant speed improvements. Reimplementing the API also gave me a finer control on the mapping of options.\n\n## R\n\nR users can use two packages to access the World Bank data:\n- [`WDI`](https://github.com/vincentarelbundock/WDI/blob/master/README.md) \n- [`wbstats`](https://github.com/GIST-ORNL/wbstats/blob/master/README.md)\n\nSee also the [Introduction to the wbstats R-package](https://cran.r-project.org/web/packages/wbstats/vignettes/Using_the_wbstats_package.html), or this [quick review](https://cengel.github.io/gearup2016/worldbank.html) of the two packages.\n\n# FAQ\n\n## Country and indicator description in non-English languages\n\nThe World Bank describes their sources and indicators in other languages than English. Use either the `language` argument in each of `get_countries`, `get_indicators`, etc, or change the default globally:\n\n```python\nwb.options.language = 'vi'\nwb.get_indicators('SP.POP.TOTL')\n```\n\n```python\nwb.options.language = 'en'\n```\n\n## Caching\n\nAll requests, except `get_series`, are cached using a _least recently used_ cache from the `cachetools` package.\n\n## Using behind a proxy\n\nUsing the package behind an http proxy is possible. Use either the `proxies` argument in the `get_*` functins, or set the proxy globally with e.g.:\n\n```python\nwb.options.proxies = {'http': 'http://example.com:3128'}\n```\n\n## License\n\nThis python package is licenced under the MIT License.\n\nPlease also read the World Bank [Terms of Use](https://data.worldbank.org/summary-terms-of-use) relative to the conditions that apply to the data downloaded with this package.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mwouts/world_bank_data", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "world-bank-data", "package_url": "https://pypi.org/project/world-bank-data/", "platform": "", "project_url": "https://pypi.org/project/world-bank-data/", "project_urls": { "Homepage": "https://github.com/mwouts/world_bank_data" }, "release_url": "https://pypi.org/project/world-bank-data/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "World Bank Data API in Python", "version": "0.1.3" }, "last_serial": 5509521, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "504fac4ac9939afbf95ed6350213204d", "sha256": "62fd0566c11a89a052416414e7bcebe91e3eb988e37afc273923436cdb458027" }, "downloads": -1, "filename": "world_bank_data-0.1.0.tar.gz", "has_sig": false, "md5_digest": "504fac4ac9939afbf95ed6350213204d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8684, "upload_time": "2019-04-06T17:56:01", "url": "https://files.pythonhosted.org/packages/3e/eb/992ad99bd33bd55501da7de6df04f89c0ccec3be4ed4ffeddaa40ffa888d/world_bank_data-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "7334763b22e7909bbbf393eae3f79d21", "sha256": "a0a47044e629dbc0882d9563db5c5137aec2163ee939eb6408f050d84278db2d" }, "downloads": -1, "filename": "world_bank_data-0.1.1.tar.gz", "has_sig": false, "md5_digest": "7334763b22e7909bbbf393eae3f79d21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11593, "upload_time": "2019-04-09T00:27:40", "url": "https://files.pythonhosted.org/packages/ba/63/4eda37a1fbe26a0083d3d43f3b41812e7895ae9907b8900b535d1d9da40a/world_bank_data-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "6e5398946087b09435076b2b4b903e49", "sha256": "1c5308ba5bff4a6c2d28343c5da4f5b39ef86f2e72dbcdd7e1f35e19ec072ec6" }, "downloads": -1, "filename": "world_bank_data-0.1.2.tar.gz", "has_sig": false, "md5_digest": "6e5398946087b09435076b2b4b903e49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11660, "upload_time": "2019-04-14T15:48:14", "url": "https://files.pythonhosted.org/packages/de/a8/8577685f373858ce6823a1ccca3b643bd73cd847099246dfe35a12660748/world_bank_data-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "d4e1d38cbcd7d447d0cca0d6990d56c0", "sha256": "e14894414d46c50dbef400b87b02fa2c16833d329ab19516df835656d5fdb631" }, "downloads": -1, "filename": "world_bank_data-0.1.3.tar.gz", "has_sig": false, "md5_digest": "d4e1d38cbcd7d447d0cca0d6990d56c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12490, "upload_time": "2019-07-09T23:26:23", "url": "https://files.pythonhosted.org/packages/97/bc/2f0b8683be344d0fe39b0c145174c04d9b3c9b4128f73b553e67f9e94368/world_bank_data-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d4e1d38cbcd7d447d0cca0d6990d56c0", "sha256": "e14894414d46c50dbef400b87b02fa2c16833d329ab19516df835656d5fdb631" }, "downloads": -1, "filename": "world_bank_data-0.1.3.tar.gz", "has_sig": false, "md5_digest": "d4e1d38cbcd7d447d0cca0d6990d56c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12490, "upload_time": "2019-07-09T23:26:23", "url": "https://files.pythonhosted.org/packages/97/bc/2f0b8683be344d0fe39b0c145174c04d9b3c9b4128f73b553e67f9e94368/world_bank_data-0.1.3.tar.gz" } ] }