Check out my post regarding the journey to rebuilding the python dashboard.
- Where to get more data for the dashboard
- Getting data from US BLS open data using BLS API key
- Getting data from US EIA website using EIA API key
- Building new layout for the CPI Python Dashboard
- Dashboard available here
- Full Code available on GitHub
What is this Dashboard?
A few months ago, I created a simple dashboard using Python Dash to visualize the CPI values, oil production, and oil prices. Dash provides an excellent framework that allows me to create a dashboard in Python. I am by no means an expert in any of this, and just learning it as I go along.
The reason I made this dashboard was to see if there was an identifiable trend between the rapidly rising oil prices and the cost of goods. I do realize that oil prices are only part of the reason why CPI goes up, some other factor could be the increase in interest rate.
Therefore, whatever trend is identifiable when comparing only oil prices and CPI is not factoring in everything that affects the CPI.
Dashboard can be viewed here (First time start up can take a bit of time).
Why Create a dashboard?
A dashboard is a really powerful way to visualize data. Power Bi and Tableau, for example, offer a simplistic way to summarize your data in one place, and can be used to compare different trends, or zoom in to focus on one particular area that you are interested in.

We can see that from North America Oil Production, Canada and US have been increasing oil production every year. However, in North America Oil Consumption, Canada and US have a relatively steady consumption of 20 million barrels per year and 3 million barrels a year respectively. This means that while Canada and US have relatively stable consumption, their supply could not keep up with the demand. It was only in 2005-2006, both Canada and US start to increase their oil production.
From 2010-2015, Canada has been producing more oil than the demand for consumption, this means Canada has been exporting a large portion of its oil production since 2010.
For Europe, oil consumption is also relatively stable around 14-15 million barrels per year, but oil production only started to increase around 2000. This means that Europe was importing oil from other countries to fulfill their oil consumption demand.
We can see that having a dashboard like this can give us insights into trends that are not intuitive from looking at the data alone.
Improvements of my dashboard
This is a dashboard using Python, but honestly, it is also quite generic. This time, I want to make some improvements to this dashboard.
Data Storage
Currently, the data in the dashboard is static, meaning I have to manually update the CSV files when there are new data. The CPI values is obtained through the US Bureau of Labor Statistics website. There are many different types of publicly available data that are available on US Bureau of Labor Statistics, but we will mostly focus on the monthly CPI values non-seasonally adjusted. US Bureau of Labor Statistics offers option to download a CSV that is specifically for loading into a database.
The oil prices and oil production data is obtained through the US EIA website, like US Bureau of Labor Statistics, they offer many publicly available data.
The dashboard is using data from 3 different CSV, the CPI values data, oil prices data, and the oil production and consumption data. I would like to combine them into one table. One way of doing it is to use SQL and Python together. The plan is to store the CPI values, oil prices, and oil production as separate tables. Using Python to join the tables together since the table share a common entry which is the date.
Dashboard Design
Vertical Scroll Bar
One of the thing I would like to add is the vertical scroll bar, it gives that abilities to see the data without having to directly hover over the data line. Without the vertical bar, it can be annoying to scroll through the data.

For example, this only shows the data for US oil production but does not show the oil production for other countries in May 2020 as well. I would like to make it so it shows all the data points for May 2020.
Adding Different Types of Graphs
As of right now, there is only a line chart on the dashboard. Preferably, I would like to include a bar chart to show a summary of data, which includes a summary to show the total production for different countries, or a summary to show the total consumption for different countries.

Currently, the line chart only shows the total production and consumption for all countries combined. The downside of the line chart only shows the trend, but it is difficult to make a direct comparison. The bar chart accurately represents which countries have more/less production and consumption.
Taking it Further
This project has been on the TO DO list for quite some time now, and this will most likely be an adventure for me as well. There has always been a few ideas about how to improve this Python dashboard, and now it is time to realize these ideas.