wbdata.fetcher library reference

Fetcher is the mechanism used by wbdata for reading, paging, caching, and converting responses from the World Bank. Luckily, most users will have no need to deal with this library, which is why it is separate.

wbdata.fetcher: retrieve and cache queries

class wbdata.fetcher.Cache

Docstring for Cache


Sync cache to disk

wbdata.fetcher.fetch(query_url, args=None, cached=True)

fetch data from the World Bank API or from cache

Query_url:the base url to be queried
Args:a dictionary of GET arguments
Cached:use the cache
Returns:a list of dictionaries containing the response to the query

Fetch a url directly from the World Bank, up to TRIES tries

Url:the url to retrieve
Returns:a string with the url contents