The project uses the data available from World Bank API Python for visualizations.
Limitation: No option to change World Bank API Database from DashBoard/GUI
In Multi App, the User can choose two indicators on x-axis and y-axis respectively. The user can look for multi-variable trends for economies.
- Trendline
- OLS
- Lowess
- Plots
- Line
- Scatter
- Add/Remove: Markers and Years
- Switch Axis Variables Button
- Indicator Descriptions (Info Button)
- Linear/Log Scales
It is one variable App where user can only change y-axis variable while x-axis is by set to Year
by default. It accepts only one indicator while it is possible to add as many economies as possible.
- OLS Trendline
- Linear/Log Scale
It is possible to switch from Simple to Multi App or vice versa.
If App was switched or refreshed, the selections will reset to default. The default settings can be changed from within scripts.
The interactive plotly has the option to download the graphs too.
World Bank API is set to World Development Indicators (WDI) Database, id=2, by the module developers. wb.source.info()
provides the list of available Databases from World Bank API.
import wbgapi as wb
wb.source.info() #provide the list of DBs
wb.db # id number of current Database i.e: (WDI=2)
In case, of a different database request, the wb.db
value has to be changed at the top of appSupport.py
wb.db = 1
Take note of Miniconda3 installation path.
- Add Miniconda3 to my PATH environment variable
- Register Miniconda3 as my default Python 3.9
The Python interpreters <= 3.8
are compatible.
sudo apt-get update
sudo apt-get install git
git clone https://github.com/mirbehroznoor/World-Bank-API-Python-DashBoard
In environment.yml
, the conda environment is named wbconda
cat environment.yml
name: wbconda channels: - conda-forge dependencies: - python==3.10 - dash==2.3.1 - wbgapi==1.0.7 - plotly==5.7.0 - pandas==1.4.2 - black - pip - pip: - statsmodels==0.13.2 - dash_bootstrap_components==1.1.0 - dash-iconify==0.1.2
bash build_env.sh
Simply run the app.py
script. The App will open in the default browser after few seconds.
cd ~/path/to/World-Bank-API-Python-DashBoard
conda activate wbconda
python app.py
Find or create .bash_aliases
in folder $HOME
Directory. Insert the function snippet:
wbapp() {
cd ~/path/to/World-Bank-API-Python-DashBoard
conda activate wbconda
python app.py
}
For shell to re-read the .bash_aliases
file, run the following command:
source ~/.bashrc
Afterwards in Terminal, simply run:
wbapp
Windows 10 Instructions.txt
Install git for windows (with default options) Install: Git for Windows
Open Git Bash Add conda.sh Path in Git Bash
#Type in Git Bash
. C:/Users/your-username/miniconda3/etc/profile.d/conda.sh
Manually open extracted path in Git Bash:
cd ~ /path/to/World-Bank-API-Python-Dashboard
bash build_env.sh #Creates Conda Environment
#Activates conda Environment
conda activate wbconda
#Runs Application
python app.py
If the App does not open automatically in your favorite browser. Visit App URL:
localhost:8050
<OR>
http://127.0.0.1:8050
To exit Git Bash server press Ctrl + C
in terminal
<OR>
To close Git Bash Enter exit
To Re-run after initial installation (for later use or once Git Bash is closed): Open Git Bash Manually navigate to extracted files path
. C:/Users/your-username/miniconda3/etc/profile.d/conda.sh
conda activate wbconda
Python app.py
The following instructions may not be accurate
Use the Git Clone
Option from PyCharm Stackoverflow: Import github Repository to PyCharm
- For Conda Env:
environment.yml
- For Pyevn Env:
requirements.txt
- Whoever can use it
- Towardsdatascience: Extract key from python dictionary
- Logrocket Blog: Data Visualization Interfaces Python Dash
- World Bank Blogs: Introducing wbgapi New Python Package Accessing World Bank Data
- Github: wbgapi
- Dash-Plotly: Interactive Graphing
- Dash-Plotly: Legend
- Dash-Plotly: Multi-Page Apps & URLs Support
- Stackoverflow: Prevent a callback from firing in dash
- Stackoverflow: Import github Repository to PyCharm
- Dash App Stylesheets: Dash Analytics Report