Data from world bank api
Project description
RhoWB: a Python Wrapper to Retrieve Data from World Bank API
Why named RhoWB? Barely any decent names are still available in Pypi.
Installation
pip install rhowb
Importing the package
import rhowb as wb
Data Sources in World Bank API
To list all data sources in World Bank, use:
wb.getsources() # from cache
wb.getsources(fromcache = False) # from web and update cache file
Topics in World Bank API
To list all topics in World Bank, use:
wb.gettopics() # from cache
wb.gettopics(fromcache = False) # from web and update cache file
Regions in World Bank
To list all regions in World Bank, use:
wb.getregions() # from cache
wb.getregions(fromcache = False) # from web and update cache file
Income levels in World Bank
WB assigns its economies to four income groups: low, lower-middle, upper-middle, and high. The classifications are updated each year on July 1, based on the GNI per capita of the previous calendar year. For example, the updated income classifications for FY2025, based on the GNI per capita of 2023.
GNI measures are expressed in US dollars using conversion factors derived according to the Atlas method. WB's income classification aims to reflect an economy’s level of development, drawing on Atlas GNI per capita as a broadly available indicator of economic capacity.
The classification of countries into income categories has evolved significantly over the period since the late 1980s. In 1987, 30% of reporting countries were classified as low-income and 25% as high-income countries. Jumping to 2023, these overall ratios have shifted down to 12% in the low-income category and up to 40% in the high-income category.
| FY | LIC | LMC | UMC | HIC | Data for Calendar Year |
|---|---|---|---|---|---|
| 2027 | <= 1175 | [1176, 4635] | [4636, 14374] | > 14375 | 2026 |
| 2026 | <= 1135 | [1136, 4495] | [4496, 13935] | > 13935 | 2024 |
| 2025 | <= 1145 | [1146, 4515] | [4516, 14005] | > 14005 | 2023 |
| 2024 | <= 1135 | [1136, 4465] | [4466, 13845] | > 13845 | 2022 |
| 2023 | <= 1085 | [1086, 4255] | [4266, 13205] | > 13205 | 2021 |
| 2022 | <= 1045 | [1046, 4095] | [4096, 12695] | > 12695 | 2020 |
| 2021 | <= 1035 | [1036, 4045] | [4046, 12535] | > 12535 | 2019 |
To list all income levels in World Bank, use:
wb.listincomelevels()
Economies in World Bank
To list all economies in World Bank, use:
wb.getecons() # from cache
wb.getecons(fromcache = False) # from web
To query information (id, region, incomelevel, etc.) of a specific economy, use economy id. e.g. to query information of China:
wb.queryeconomy('CHN')
To query information of economies in a specific region, use region id. e.g. to query information of economies in East Asia & Pacific:
wb.queryeconomy(region = 'EAS')
To query information of economies in a specific income level, use income level id. e.g. to query information of economies of High income:
wb.queryeconomy(incomelevel = 'HIC')
Querying Indicators
To query indicators, use:
wb.queryindicator(name = 'GDP')
To restrict data source, use 'source' (source id) option:
wb.queryindicator(name = 'GDP', source = '2')
Retrieving Data
To retrieve total population data of China and India from 2000 to 2025, use:
wb.getdata(
'SP.POP.TOTL',
'CHN;IND',
period = '2000:2025'
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rhowb-1.0.4-py3-none-any.whl.
File metadata
- Download URL: rhowb-1.0.4-py3-none-any.whl
- Upload date:
- Size: 862.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27b6e533a36b77037309c3da513984d9167bd9d00c8fb0fa7bb8a0138421cbfc
|
|
| MD5 |
cc74a4ba31e457f90feb723d6e6d5f49
|
|
| BLAKE2b-256 |
235b43800b07b8bebb20a6ed5fb959dac3aed122a261ff42c6a688eb49ffc1a9
|