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.
pip install wbdataVerified import paths — ran on the pinned version, not inferred.
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.
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.
Upgrade your Python environment to 3.10 or newer to use `wbdata` 1.1.0+. Ensure your development environment meets the `requires_python` specification.
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.
Remove the `display` argument from calls to search functions. Handle the returned list directly; its `__repr__` method provides the tabular display in interactive environments.
Install the library using pip: `pip install wbdata`
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.
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]`.
Correct the function name to `wbdata.get_dataframe()`.