Transform data.worldbank.org/indicator csv files into one variable panel data, multivariable time series data, multivariable cross section data, or multivariable panel data.
Project description
World Bank Data Query Tool
- Multi .csv Files
- Transform World Bank Data Indicator
- One Variable Panel Data
- MultiVariable Time Series Data
- MultiVariable Cross Section Data
- MultiVariable Panel Data (New!)
Requirements
- python 3.xx
- pandas 1.4.2
How to Install
pip install worldbankdatatransform
How to Use
from worldbankdatatransform import get_filename_dict, WorldBankDataTransform
download csv files that you want at data.worldbank.org/indicator and you csv files must stored in a folder with appropriate filename, i.e inflation.csv, constant-gdp.csv
your_path = 'your csv folder path' ## i.e D:/world-bank/data
filename = get_filename_dict(path=your_path)
# Create an object
wb_files = WorldBankDataTransform(filename=filename, path=your_path)
One Variable Panel Data
Transform world bank csv files into
| year | country_1 | country_2 | ... | country_n |
|---|---|---|---|---|
for example:
G4_countries = ['United Kingdom', 'France', 'Germany', 'Italy']
inflation = "inflation" # csv file name of the variable you want, without '.csv'
G4_countries_inflation = wb_files.onevar_panel_data(key_name=inflation,
country_list=G4_countries,
start_year = None,
end_year = None,
save_file=False,
path=None,
filename_save=None)
G4_countries_inflation is a pandas DataFrame
Multivariable Time Series Data
Transform world bank csv files into specific country's multivariable:
| year | variable_1 | variable_2 | ... | variable_n |
|---|---|---|---|---|
country = "Vanuatu"
vanuatu_time_series = wb_files.multivar_time_series(country=country,
start_year = None,
end_year = None
save_file=False,
path=None,
filename_save=None)
vanuatu_time_series is a pandas DataFrame
Multivariable Cross Section Data
Transform world bank csv files into specific year multivariable of countries:
| country | variable_1 | variable_2 | ... | variable_n |
|---|---|---|---|---|
world_in_2019 = wb_files.multivar_cross_section(year=2019,
country_list=None,
save_file=False,
path=None,
filename_save=None)
you can also specify country list included in the DataFrame
i.e
asean_5 = ['Indonesia', 'Malaysia', 'Singapore', 'Thailand', 'Philippines']
and store into country_list parameter
Multivariable Panel Data
Transform world bank csv files into specific year multivariable of countries:
| country | year | variable_1 | variable_2 | .... | variable_n |
|---|---|---|---|---|---|
all_countries_panel_data = wb_files.multivar_panel_data(country_list=None,
start_year = None,
end_year = None,
save_file=False,
path=None,
filename_save=None)
How to Save into csv Files
Set the save_file=True,
path='your save file folder path',
filename_save='your_data_filename.csv'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 worldbankdatatransform-0.0.2.tar.gz.
File metadata
- Download URL: worldbankdatatransform-0.0.2.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ca1e72fe8113dcec1c4ef6d2a583abe0424a19d8e65eb2cfe7e57b563fbb5bb
|
|
| MD5 |
7994ce801f5b848af22cc50b64e5e033
|
|
| BLAKE2b-256 |
6ada868c4d73966841ae06fb6d61bb6533187d0347044bce859cc6c881598dbd
|
File details
Details for the file worldbankdatatransform-0.0.2-py3-none-any.whl.
File metadata
- Download URL: worldbankdatatransform-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
969c30bcf7e32c9ff248357a9efed6e4758bcab18535eefe96e4ec3188989354
|
|
| MD5 |
acbd107e05e44450c280cd9137898f13
|
|
| BLAKE2b-256 |
f2afb54726fb2e6eeedffa55409bf6499223bd1e8385e14e0f5063eac88cad48
|