An end-to-end HR analytics project that automates data cleaning, database storage, exploratory analysis, visualization, and automated reporting using Python, SQLite, and Power BI.
This project analyzes employee attrition using the IBM HR Analytics dataset and builds a fully automated analytics pipeline:
- CSV → Auto Data Cleaning → Feature Engineering
- SQLite Database Storage
- Exploratory Data Analysis (EDA) in Python
- Automated chart generation
- PDF report generation (fpdf2) with dynamic, data-driven insights
- Power BI dashboard integration fed directly from cleaned data output
The goal is to simulate a real-world HR analytics workflow used in business environments.
CSV Dataset (IBM HR Attrition) — new or updated data dropped here
↓
Auto Data Cleaning & Feature Engineering (Python - pandas) — triggers automatically
↓
Save Cleaned Data (CSV) — used as Power BI data source
↓
Store in SQLite Database (employee_attrition table)
↓
Exploratory Data Analysis (Python / pandas)
↓
Generate Charts (matplotlib)
↓
Save Charts as PNG (output/charts/)
↓
Generate PDF Report (fpdf2) — dynamic insights auto-calculated from data
↓
Power BI Dashboard (interactive analysis) — reads from cleaned CSV, refreshes on next open
↓
Final Output: HR Analytics Report + Dashboard Insights
✔ Automated data pipeline (ETL) — automatically cleans and processes new data, then updatethe Power BI report
✔ Feature engineering (Income bands, Age groups)
✔ Attrition analysis across departments, roles, and demographics
✔ Automated PDF report generation (fpdf2)
✔ Dynamic, data-driven insights and conclusion — auto-updated when data changes
✔ Styled multi-page PDF — cover page, KPI cards, progress bars, themed charts
✔ Timestamped reports — each PDF records when it was generated
✔ Data visualization (matplotlib) with consistent color theming
✔ Power BI dashboard for interactive insights — always reflects latest cleaned data
- Python (pandas, matplotlib, seaborn)
- SQLite
- fpdf2 (PDF report generation)
- schedule (automation-ready)
- Power BI
- VS Code
The Power BI dashboard connects directly to the cleaned CSV output. Re-running the pipeline with updated raw data will automatically refresh the dashboard on next open.
Employees who work overtime show significantly higher attrition rates, indicating workload imbalance and work-life pressure as key retention risks.
The report automatically identifies whichever department has the highest attrition count and rate, no manual updates needed when data changes.
Employees in lower income bands are more likely to leave. The report calculates and displays the real income gap between employees who left and those who stayed.
If job satisfaction data is available, the report automatically includes a satisfaction score comparison between leavers and stayers.
The report conclusion dynamically reflects the current attrition rate:
- Below 10% → "healthy and within acceptable range"
- 10–20% → "moderate and warrants attention"
- Above 20% → "high and requires immediate intervention"
The system generates a fully styled, data-driven PDF report containing:
- Cover page — title banner, KPI summary cards, timestamp
- Workforce Overview — styled department table with totals
- Department Analysis — attrition breakdown with visual progress bars
- Visual Insights — themed matplotlib charts (attrition, income, overtime)
- Key Insights — auto-calculated findings from live data
- Conclusion — tone and content driven by actual attrition metrics
All insights and the conclusion are generated programmatically from the database — re-running the script after a data update will automatically reflect the latest findings.
hr-attrition-analysis/
│
├── data/
│ ├── raw/
│ ├── cleaned/
│
├── sql/
│ ├── hr_analytics.db
│ └── hr_db.sqlite
│
├── scripts/
│ ├── 01_explore.py
│ ├── 02_clean_data.py
│ ├── 03_load_to_sql.py
│
├── notebooks/
│ └── hr_analysis.ipynb
│
├── output/
│ ├── charts/
│ └── figures/
│
├── generate\_report.py
├── HR_Attrition_Report.pdf
├── run_pipeline.py
└── README.md
Workload (overtime), compensation, and department-level pressures are the primary drivers of employee attrition. The automated pipeline ensures that whenever raw HR data is updated, the entire workflow cleaning, database storage, PDF report, and Power BI dashboard reflects the latest state of the workforce without any manual intervention.


