Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

worldbankdatatransform-0.0.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

worldbankdatatransform-0.0.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

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

Hashes for worldbankdatatransform-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4ca1e72fe8113dcec1c4ef6d2a583abe0424a19d8e65eb2cfe7e57b563fbb5bb
MD5 7994ce801f5b848af22cc50b64e5e033
BLAKE2b-256 6ada868c4d73966841ae06fb6d61bb6533187d0347044bce859cc6c881598dbd

See more details on using hashes here.

File details

Details for the file worldbankdatatransform-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for worldbankdatatransform-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 969c30bcf7e32c9ff248357a9efed6e4758bcab18535eefe96e4ec3188989354
MD5 acbd107e05e44450c280cd9137898f13
BLAKE2b-256 f2afb54726fb2e6eeedffa55409bf6499223bd1e8385e14e0f5063eac88cad48

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page