{"id":2357,"library":"wbdata","title":"WBData - World Bank Data Client","description":"WBData is a Python library designed to simplify access to data from the World Bank's Indicators API. It provides an intuitive interface for searching indicators, countries, topics, and sources, and for retrieving time-series data. The current version is 1.1.0, with recent releases indicating active maintenance and regular updates.","status":"active","version":"1.1.0","language":"python","source_language":"en","source_url":"https://github.com/OliverSherouse/wbdata","tags":["world bank","data","api","economics","finance","indicators"],"install":[{"cmd":"pip install wbdata","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"For returning data as Pandas DataFrames, which is a common and highly recommended use case.","package":"pandas"},{"reason":"Underpins HTTP requests to the World Bank API.","package":"requests"},{"reason":"Provides in-memory caching of API responses to improve performance and reduce redundant calls.","package":"cachetools"}],"imports":[{"note":"The primary way to use the library; all main functions are methods of the `wbdata` module (e.g., `wbdata.get_dataframe`).","symbol":"wbdata","correct":"import wbdata"}],"quickstart":{"code":"import wbdata\nimport datetime\n\n# Define the date range from 2000 to 2010\ndata_date = datetime.datetime(2000, 1, 1), datetime.datetime(2010, 1, 1)\n\n# Define countries using their ISO2 codes\ncountries = [\"FR\", \"DE\", \"IT\"]\n\n# Define indicators with human-readable aliases\nindicators = {\"NY.GDP.PCAP.CD\": \"GDP per Capita\", \"SP.POP.TOTL\": \"Total Population\"}\n\n# Get data as a Pandas DataFrame\ndf = wbdata.get_dataframe(indicators, country=countries, data_date=data_date)\nprint(\"\\n--- Sample Data (GDP per Capita, Total Population) ---\")\nprint(df.head())\n\n# Get information about a specific indicator\nprint(\"\\n--- Indicator Info for GDP per Capita ---\")\nindicators_info = wbdata.get_indicator(\"NY.GDP.PCAP.CD\")\nfor key, value in indicators_info.items():\n    print(f\"{key}: {value}\")\n\n# Search for indicators containing 'population'\nprint(\"\\n--- Search Results for 'population' ---\")\npopulation_indicators = wbdata.search_indicator(\"population\")\n# In an interactive shell or notebook, printing the list directly would show a table\nprint(f\"Found {len(population_indicators)} indicators matching 'population'. Showing first 3:\\n{population_indicators[:3]}\")\n","lang":"python","description":"Demonstrates how to fetch time-series data for multiple indicators and countries, retrieve metadata about indicators, and perform searches for available indicators. Data is typically returned as a Pandas DataFrame for easy manipulation."},"warnings":[{"fix":"Consult the v1.0.0 documentation or examples for updated function and argument names (e.g., `get_dataframe` replaces older data retrieval methods). The overall data retrieval pattern has shifted.","message":"The 1.0.0 release introduced significant architectural changes, renaming many functions and arguments for consistency and clarity. Code written for pre-1.0.0 versions will likely break.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Upgrade your Python environment to 3.10 or newer to use `wbdata` 1.1.0+. Ensure your development environment meets the `requires_python` specification.","message":"Version 1.1.0 dropped support for older, End-of-Life Python versions, now requiring Python >=3.10. Additionally, version 0.3.0 previously dropped support for Python <= 3.5.","severity":"breaking","affected_versions":"<1.1.0 on Python <3.10; <0.3.0 on Python <3.6"},{"fix":"For older versions, ensure `datetime.datetime` objects are consistently used. For v1.0.0+, while strings offer flexibility, use `datetime.datetime` objects for precise control over start and end dates in date ranges to avoid ambiguity.","message":"Prior to v1.0.0, date arguments exclusively required `datetime.datetime` objects. Since v1.0.0, string representations for years, months, or quarters are also accepted, which can lead to different interpretations of date ranges.","severity":"gotcha","affected_versions":"<1.0.0"},{"fix":"Remove the `display` argument from calls to search functions. Handle the returned list directly; its `__repr__` method provides the tabular display in interactive environments.","message":"The `display` argument in search functions (e.g., `search_indicator`, `search_country`) was removed in v0.3.0. These functions now return lists that pretty-print as tables when directly expressed in a shell or notebook.","severity":"breaking","affected_versions":"<0.3.0"}],"env_vars":null,"search_vec":"'1.1.0':47 'access':14 'activ':52 'api':23,60 'bank':3,20,58 'client':5 'countri':32 'current':44 'data':4,16,42,59 'design':11 'econom':61 'financ':62 'indic':22,31,51,63 'interfac':28 'intuit':27 'librari':10 'mainten':53 'provid':25 'python':9 'recent':49 'regular':55 'releas':50 'retriev':38 'search':30 'seri':41 'simplifi':13 'sourc':35 'time':40 'time-seri':39 'topic':33 'updat':56 'version':45 'wbdata':1,6 'world':2,19,57","created_at":"2026-04-09T18:54:33.311907+00:00","updated_at":"2026-04-17T00:29:21.870115+00:00","problems":[{"fix":"Install the library using pip: `pip install wbdata`","cause":"The 'wbdata' library has not been installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'wbdata'"},{"fix":"Verify the accuracy of indicator codes, country codes, and date ranges using `wbdata.get_indicators()`, `wbdata.get_countries()`, etc., and ensure they conform to World Bank API requirements.","cause":"The World Bank API returned an error, often due to invalid or malformed parameters provided in the `wbdata` function call (e.g., incorrect indicator code, country code, or an unsupported combination).","error":"requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: ..."},{"fix":"Provide the date as a tuple for a range or a list for specific years, e.g., `date=(2010, 2010)` for a single year, or `date=[2010, 2011]`.","cause":"The `date` argument in `wbdata.get_dataframe()` or similar functions was provided as a single string (e.g., \"2010\") when it expects an iterable like a tuple `(start_year, end_year)` or a list of specific years `[year1, year2]`.","error":"TypeError: cannot unpack non-iterable str object"},{"fix":"Correct the function name to `wbdata.get_dataframe()`.","cause":"A common typo was made in the function name `get_dataframe` by adding an 's' at the end, or an attempt was made to call a non-existent method.","error":"AttributeError: module 'wbdata' has no attribute 'get_dataframes'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.1.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/OliverSherouse/wbdata","docs":"https://wbdata.readthedocs.io/","changelog":null,"pypi":"https://pypi.org/project/wbdata/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-28","next_check":"2026-07-28","install_tag":null}}