Skip to content

RanjaniAnjurVenkatraman/Pharmaceutical_Web_Application_using_ETL_Process

Repository files navigation

image

Table of Contents

=================

  1. About This Project
  2. Flask App
  3. Visualizations
  4. Contributors

About This Project

Our team was interested in exploring healthcare data. We extracted pharmaceutical spending data across the globe to determine how much each country is spending on off the shelf pharmaceutical medicines. Data was extracted from CSV and JSON sources, transformed using Python, Pandas and SQL. Data was then loaded into PostgreSQL. SQLAlchemy was used with Flask to deploy results to a pharmaceutical web application.

This web application can be used by pharmaceutical companies to promote products globally.

Technologies 🔨

image image image image image image image image

Architectural Diagram


ETL Process

Extract

Pharmaceutical and Population datasets were extracted from the following CSV and JSON sources. EDA was performed on the data.

Transform

Data was transformed and cleaned using Python, Pandas and SQL. Transformations include:

  • Filtering the population dataframe for year = 2018. The year 2018 was the latest data available.
  • Filtering based on ‘% of Pharmaceutical spending’
  • Changing column datatypes
  • Renaming columns
  • Retrieving required columns and dropping unwanted columns to load into PostgreSQL

Load

Due to the relational nature of the population and pharmaceutical spending data, we decided to use PostgreSQL. Pandas was used to load dataframes into the database. Tables were merged on ‘country code’ using SQL in PostgreSQL. SQLAlchemy was then used with Flask to deploy results to an HTML page.

Flask App

A Flask application was created to display data for the following routes:

  • /


  • /population


  • /pharma_spending


  • /population_pharma_spending


How to Run The Application

  1. Ensure Flask is installed in the virtual environment: 'python -m pip install flask'.
  2. Clone this repository to run on your local machine.
  3. In the virtual environment, navigate to the 'Pharmaceutical App' folder.
  4. In the virtual environment, run the app by using the command'python app.py'
  5. To open your default browser to the rendered page, Ctrl+click the http://127.0.0.1:5000/ URL in the terminal.
  6. On the webpage, click 'Routes' to view and explore Population, Pharmaceutical and Pharmaceutical Spending data.

Visualizations

Countries with the highest pharmaceutical spend include:

Countries with the lowest pharmaceutical spend include:

Contributors

About

Extraction, Transformation and Loading

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published