{"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":"en","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,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}