What's New
What's new in wbdata 1.0
The 1.0 release of wbdata is not quite a full rewrite, but is pretty much the next best thing. The architecture has been reworked, function and argument names have been changed to be more consistent and clear, and a few dependencies have been added for better and more reliable functionality.
Features
- Date arguments can now be strings, not just
datetime.datetimeobjects. Strings can be in the year, month, or quarter formats used by the World Bank API or in any other format that can be handled by [dateparser][https://dateparser.readthedocs.io/en/latest/]. - Default cache behavior can be configured with environment variables, including the path, TTL, and max number of items to cache. See Cache Module documentation for details.
- Users can now create
Clientobjects if they want to set cache behavior programmatically have multiple caches, or supply their own requests Session. - Caching is now provided using the shelved_cache and cachetools libraries. Since a lot of annoying bugs seemed to come from wbdata's home-rolled cache implementation, this should be a good quality-of-life improvement for many people.
- Type annotations are available.
Breaking API Changes
- Supported version of Python are now 3.8+.
-
All of the metadata retrieval functions have been renamed to their plural forms to reflect the fact that they always return a sequence:
Old Name New Name get_countryget_countriesget_indicatorget_indicatorsget_incomelevelget_incomelevelsget_lendingtypeget_lendingtypesget_topicget_topicsget_sourceget_sources -
The functions
search_countriesandsearch_indicatorshave been removed. Searching by name is now available using thequeryparameter of theget_countriesandget_indicatorsfunctions. - The parameter
data_datehas been renameddate. - The parameter
convert_dateshas been renamedparse_dates. - The parameter
cachewith a default valueTruehas been replaced with a parameterskip_cachewith a default value ofFalse.