Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hospital Management System ETL Pipeline

A beginner-friendly ETL (Extract, Transform, Load) project built with Python, Pandas, and MySQL.

The project reads patient records from a CSV file, validates the data using business rules, and loads clean records into a MySQL database using parameterized SQL queries.


Features

  • Read patient data from CSV
  • Validate patient records before insertion
  • Remove duplicate records
  • Remove NULL values
  • Validate patient age
  • Validate Pakistani phone numbers
  • Validate blood groups
  • Validate gender values
  • Validate registration dates
  • Insert data into MySQL
  • Import summary showing successful and failed records

Technologies Used

  • Python 3
  • Pandas
  • MySQL
  • MySQL Connector for Python

Project Structure

Hospital-Management-System/

data/
python/
sql/
screenshots/
README.md

ETL Workflow

patients.csv
      │
      ▼
Extract (Read CSV)
      │
      ▼
Transform
- Remove duplicates
- Remove NULL values
- Validate age
- Validate phone
- Validate blood group
- Validate gender
- Validate dates
      │
      ▼
Load (Insert into MySQL)

Validation Rules

Validation Description
Duplicate Check Removes duplicate records
NULL Check Removes incomplete records
Age Validation Accepts ages between 0 and 120
Phone Validation Accepts valid Pakistani mobile numbers
Blood Group Validation Allows only valid blood groups
Gender Validation Male, Female, Other
Date Validation Registration date cannot be in the future

Setup

Clone the repository

git clone https://github.com/kmustajabjava/Hospital-Management-System.git

Install dependencies

pip install -r requirements.txt

Configure database

Edit

python/config.py

Update

host
user
password
database

Run SQL scripts

sql/

to create the database and tables.


Run the Project

cd python

python import_patients.py

Sample Output

===== IMPORT SUMMARY =====

Successfully Imported : 5

Failed Imports : 0

Database connection closed.

Skills Demonstrated

  • ETL Pipeline Development
  • Python Programming
  • Pandas Data Processing
  • SQL
  • MySQL
  • Data Validation
  • Database Connectivity
  • Exception Handling
  • Transaction Management

Author

Kainat M Ahmed

About

Python ETL pipeline using Pandas and MySQL

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages