Skip to main content

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'

Metadata

Release files for worldbankdatatransform 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for worldbankdatatransform 0.0.2
File Size Uploaded Provenance
worldbankdatatransform-0.0.2.tar.gz 4.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for worldbankdatatransform 0.0.2
File Interpreter ABI Platform
worldbankdatatransform-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.9 kB

Release files / worldbankdatatransform-0.0.2.tar.gz

Download URL worldbankdatatransform-0.0.2.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4ca1e72fe8113dcec1c4ef6d2a583abe0424a19d8e65eb2cfe7e57b563fbb5bb
BLAKE2b-256 checksum
How to use checksums
6ada868c4d73966841ae06fb6d61bb6533187d0347044bce859cc6c881598dbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release files / worldbankdatatransform-0.0.2-py3-none-any.whl

Download URL worldbankdatatransform-0.0.2-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
969c30bcf7e32c9ff248357a9efed6e4758bcab18535eefe96e4ec3188989354
BLAKE2b-256 checksum
How to use checksums
f2afb54726fb2e6eeedffa55409bf6499223bd1e8385e14e0f5063eac88cad48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Security for worldbankdatatransform 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page