An End-to-End GitHub Analytics Database and Data Warehouse project built with Python, PostgreSQL, Advanced SQL, and Medallion Architecture.
The project simulates GitHub's interconnected Software-Development Data and Transforms it through a structured Bronze → Silver → Gold data warehouse pipeline. The final Gold layer provides Business-ready Fact tables, Dimension tables, Analytical Views, and SQL-based insights for Repository, Developer, Commit, Pull Request, Issue, Release, Organization, Programming Language, Community, and Data-Quality Analysis.
Project Scope: This project is focused on Data Engineering, Data Warehousing, ETL, Advanced SQL, Data Quality, and Analytical Reporting through SQL. Dashboard development is intentionally outside the final project scope.
- Project Structure
- Project Overview
- Business Problem
- Project Objectives
- Key Business Questions
- Data Warehouse Architecture
- Database Schema
- Data Warehouse Layers
- Technology Stack
- Data Generation
- ETL Pipeline
- Gold Layer
- SQL Analysis
- Data Quality
- Testing
- Setup and Installation
- Execution Workflow
- Documentation
- Key Outcomes
- Future Enhancements
- Dataset Disclaimer
- Author
GitHub-Analytics-Database/
│
├── README.md
├── requirements.txt
├── LICENSE
│
├── Docs/
│ ├── Business_Problem.md
│ ├── Objectives.md
│ ├── Business_Questions.md
│ ├── Entity_Identification.md
│ ├── Relationship_Design.md
│ ├── Data_Generation_Documentation.md
│ └── Data_Catalog.md
│
├── Data/
│ ├── Raw/
│ │ └── Raw_GitHub_Data.zip
│ └── Processed/
│ └── Processed_GitHub_Data.zip
│
├── Data_Generator/
│ ├── Config.py
│ ├── Master_data.py
│ ├── Utils.py
│ ├── Main.py
│ └── Generators/
│ ├── __init__.py
│ ├── Users.py
│ ├── Organizations.py
│ ├── Organization_Members.py
│ ├── Programming_Languages.py
│ ├── Repositories.py
│ ├── Repository_Languages.py
│ ├── Repository_Contributors.py
│ ├── Branches.py
│ ├── Commits.py
│ ├── Pull_Requests.py
│ ├── Pull_Request_Reviews.py
│ ├── Issues.py
│ ├── Releases.py
│ ├── Stars.py
│ └── Forks.py
│
├── ETL/
│ ├── Python-Scripts/
│ │ ├── Init_database.py
│ │ ├── Bronze/
│ │ │ ├── DDL_Bronze.py
│ │ │ └── Load_Bronze.py
│ │ ├── Silver/
│ │ │ ├── DDL_Silver.py
│ │ │ ├── Cleaning_Functions.py
│ │ │ └── Load_Silver.py
│ │ └── Gold/
│ │ ├── DDL_Gold.py
│ │ ├── Load_Gold.py
│ │ └── Gold_Reporting_Views.py
│ │
│ └── SQL-Scripts/
│ ├── Init_database.sql
│ ├── Bronze/
│ │ ├── DDL_Bronze.sql
│ │ └── Proc_Load_Bronze.sql
│ ├── Silver/
│ │ ├── DDL_Silver.sql
│ │ ├── Cleaning_Functions.sql
│ │ └── Proc_Load_Silver.sql
│ └── Gold/
│ ├── DDL_Gold.sql
│ ├── Proc_Load_Gold.sql
│ └── Gold_Reporting_Views.sql
│
├── Logs/
│ ├── Init_database.log
│ ├── DDL_Bronze.log
│ ├── Load_Bronze.log
│ ├── DDL_Silver.log
│ ├── Cleaning_Functions.log
│ ├── Load_Silver.log
│ ├── DDL_Gold.log
│ ├── Load_Gold.log
│ └── Gold_Reporting_Views.log
│
├── SQL-Analysis/
│ ├── Developer_Productivity.sql
│ ├── Commit_Analytics.sql
│ ├── Pull_Request_Analytics.sql
│ ├── Issue_Analytics.sql
│ ├── Release_Analytics.sql
│ ├── Organization_Analytics.sql
│ ├── Programming_Language_Analytics.sql
│ ├── Community_Engagement_Analytics.sql
│ ├── Data_Quality_Analytics.sql
│ └── Executive_Analytics.sql
│
├── Tests/
│ ├── Test_Bronze.sql
│ ├── Test_Silver.sql
│ ├── Test_Gold.sql
│ ├── Test_Data_Integrity.sql
│ └── Test_Business_Logic.sql
│
└── Images/
├── Database_Schema.png
└── Data_Warehouse_Architecture.png
GitHub generates a large volume of interconnected software-development data involving:
- Users
- Organizations
- Repositories
- Programming languages
- Repository contributors
- Branches
- Commits
- Pull requests
- Pull request reviews
- Issues
- Releases
- Stars
- Forks
Although these entities are highly valuable for analysis, their relationships and operational structure make analytical querying more complex.
This project solves that problem by building a centralized PostgreSQL-based analytical database that:
- Generates realistic synthetic GitHub data.
- Loads raw data into a Bronze layer.
- Cleans and standardizes data in the Silver layer.
- Builds business-ready Gold dimensions and fact tables.
- Creates analytical reporting views.
- Uses Advanced SQL to answer business questions.
- Applies data-quality and integrity testing throughout the pipeline.
The project follows an industry-inspired Medallion Architecture to separate raw ingestion, transformation, and analytical consumption layers.
Software engineering teams need reliable visibility into development activity to understand repository performance, developer contribution, collaboration, issue management, release activity, and community engagement.
However, GitHub-style operational data introduces several challenges:
- Data is distributed across multiple interconnected entities.
- Relationships between developers, repositories, commits, issues, and pull requests are complex.
- Raw data is not optimized for analytical queries.
- Missing values, duplicates, malformed values, and inconsistent data can affect analytical accuracy.
- Repeated analytical queries can become complex without a well-designed warehouse layer.
The GitHub Analytics Database addresses these challenges by creating a centralized analytical data warehouse with controlled data generation, automated ETL, data-quality processing, dimensional modeling, and business-ready SQL views.
Build a production-inspired GitHub Analytics Database that transforms synthetic operational GitHub data into reliable, business-ready analytical datasets using PostgreSQL, Python, ETL, Medallion Architecture, and Advanced SQL.
- Design a relational PostgreSQL data warehouse.
- Generate realistic synthetic GitHub datasets.
- Maintain relationships between interconnected GitHub entities.
- Simulate real-world data-quality problems.
- Implement Bronze, Silver, and Gold layers.
- Develop modular Python ETL scripts.
- Develop equivalent SQL-based ETL scripts.
- Apply data cleaning and standardization.
- Maintain primary-key and foreign-key integrity.
- Create Gold-layer fact and dimension tables.
- Create analytical reporting views.
- Develop SQL analysis for business questions.
- Implement automated logging and error handling.
- Validate the data warehouse through SQL tests.
The analytical layer is designed to answer questions across the following areas.
- Which repositories have the highest number of commits?
- Which repositories have the highest number of contributors?
- Which repositories receive the most pull requests?
- Which repositories have the highest number of issues?
- Which repositories receive the most stars?
- Which repositories have been forked the most?
- How does repository activity change over time?
- Which developers create the most commits?
- Which developers open the most pull requests?
- Which developers merge the most pull requests?
- Which developers review the most pull requests?
- Which developers resolve the most issues?
- Which developers contribute to the highest number of repositories?
- Which developers own the most repositories?
- What is the average number of commits per active developer?
- How many commits are created over time?
- What are the peak development periods?
- Which repositories receive commits most frequently?
- Which branches contain the highest number of commits?
- What is the average number of lines added per commit?
- What is the average number of lines deleted per commit?
- Which developers make the largest code contributions?
- How many pull requests are created, merged, open, and closed?
- What is the average pull request review time?
- Which repositories have the highest merge rate?
- Which developers submit the most pull requests?
- Which reviewers approve the most pull requests?
- What percentage of pull requests require changes?
- How many issues are open and resolved?
- What is the average issue resolution time?
- Which repositories have the most issues?
- Which developers resolve the most issues?
- What percentage of issues remain unresolved?
- Which repositories receive the most critical issues?
- How many releases are published?
- Which repositories publish releases most frequently?
- What is the average time between releases?
- Which repositories have the fastest release cycle?
- What is the monthly release trend?
- How many organizations exist?
- Which organizations own the most repositories?
- Which organizations have the most developers?
- Which organizations generate the most commits?
- Which organizations receive the most stars?
- Which organizations resolve the most issues?
- Which organizations publish the most releases?
- Which programming languages are used most frequently?
- Which repositories use multiple programming languages?
- Which language has the highest number of repositories?
- Which language generates the most commits?
- Which language has the highest community engagement?
- Which organizations primarily use Python?
- Which repositories use SQL?
- Which repositories have the highest number of stars?
- Which repositories have the highest number of forks?
- Which developers receive the most followers?
- Which repositories attract the largest contributor communities?
- What is the relationship between stars and forks?
- Which organizations receive the highest community engagement?
- How many duplicate records were identified?
- How many records contain missing values?
- How many malformed email addresses were detected?
- How many records failed validation?
- How many records were retained after transformation?
- How many records were rejected or excluded during processing?
- What is the overall quality of the transformed datasets?
The project follows the Medallion Architecture:
┌───────────────────────┐
│ Synthetic Raw Data │
│ CSV Files │
└───────────┬───────────┘
│
▼
┌───────────────────────┐
│ BRONZE LAYER │
│ Raw Data │
│ Minimal Transformation│
└───────────┬───────────┘
│
▼
┌───────────────────────┐
│ SILVER LAYER │
│ Cleaned & Standardized│
│ Data │
└───────────┬───────────┘
│
▼
┌───────────────────────┐
│ GOLD LAYER │
│ Business-Ready Facts │
│ Dimensions & Views │
└───────────┬───────────┘
│
▼
┌───────────────────────┐
│ Advanced SQL │
│ Analysis & Reporting │
└───────────────────────┘
The PostgreSQL database acts as the central data warehouse, while Python and SQL scripts automate the ingestion and transformation processes.
The Gold layer uses a dimensional data warehouse design consisting of dimension tables and fact tables.
dim_usersdim_organizationsdim_repositoriesdim_branchesdim_languages
fact_organization_membersfact_repository_languagesfact_repository_contributorsfact_commitsfact_pull_requestsfact_pull_request_reviewsfact_issuesfact_releasesfact_starsfact_forks
The dimensional model connects users, organizations, repositories, branches, and programming languages with GitHub activity facts.
The Bronze layer stores the generated raw datasets with minimal transformation.
- Raw data ingestion
- Initial storage
- Batch loading
- Full-load processing
- Truncate-and-insert loading
- Preservation of source-level data
- Raw data
- Minimal transformation
- Source-oriented structure
- PostgreSQL tables
The Silver layer converts raw data into clean, standardized, and validated datasets.
- Duplicate handling
- Missing-value treatment
- Data type standardization
- Value normalization
- Invalid-data handling
- Data validation
- Referential integrity checks
- Data enrichment
The Silver layer provides a trusted foundation for downstream analytical modeling.
The Gold layer contains business-ready analytical structures.
- Dimension tables
- Fact tables
- Reporting views
- Aggregated metrics
- Business logic
- Analytical summaries
The Gold layer is designed to simplify complex analytical queries and provide consistent datasets for SQL-based reporting.
Synthetic GitHub data is generated using Python.
The generator creates interconnected datasets for:
- Programming Languages
- Users
- Organizations
- Organization Members
- Repositories
- Repository Languages
- Repository Contributors
- Branches
- Commits
- Pull Requests
- Pull Request Reviews
- Issues
- Releases
- Stars
- Forks
The generation process maintains relationships between entities so that downstream ETL processing can simulate realistic GitHub data.
The generator also supports the creation of controlled data-quality issues such as missing values, duplicate records, malformed values, and invalid data.
The ETL process is implemented using both Python scripts and PostgreSQL SQL scripts.
Synthetic Data
│
▼
Raw CSV Files
│
▼
Bronze Loading
│
▼
Bronze Tables
│
▼
Cleaning & Validation
│
▼
Silver Tables
│
▼
Business Transformations
│
▼
Gold Fact & Dimension Tables
│
▼
Gold Reporting Views
│
▼
Advanced SQL Analysis
Init_database.py
Creates and initializes the required PostgreSQL database structures.
DDL_Bronze.pyLoad_Bronze.py
Responsible for creating Bronze tables and loading raw datasets.
DDL_Silver.pyCleaning_Functions.pyLoad_Silver.py
Responsible for data cleaning, standardization, validation, and loading into Silver tables.
DDL_Gold.pyLoad_Gold.pyGold_Reporting_Views.py
Responsible for creating Gold dimensions/facts, loading business-ready data, and creating analytical reporting views.
The Gold layer is the analytical core of the project.
gold.repository_performance_summary
Provides repository-level metrics including:
- Total commits
- Recent commit activity
- Contributors
- Pull requests
- Issues
- Releases
- Stars
- Forks
- Repository metadata
gold.developer_productivity_summary
Provides developer-level metrics including:
- Repositories owned
- Repositories contributed to
- Commits authored
- Pull requests opened
- Pull requests merged
- Pull requests reviewed
- Pull requests approved
- Issues resolved
gold.repository_monthly_activity
Combines monthly repository activity across:
- Commits
- Pull requests
- Issues
- Releases
- Stars
gold.developer_monthly_activity
Tracks developer commit activity by month.
gold.organization_summary
Provides organization-level metrics such as:
- Repository count
- Member count
- Commits
- Stars
- Resolved issues
- Releases
- Commits per member
gold.language_adoption_summary
Analyzes programming language adoption based on:
- Repositories using the language
- Repositories where the language is primary
- Commit activity
- Stars
gold.pull_request_efficiency_summary
Provides:
- Pull request counts
- Merge rate
- Average time to merge
- Average time to first review
- Change-request percentage
gold.issue_resolution_summary
Provides:
- Total issues
- Open issues
- Closed issues
- Closure rate
- Unresolved rate
- Average resolution time
- Critical issues
- High-priority issues
gold.release_analytics_summary
Provides:
- Total releases
- First release
- Latest release
- Average days between releases
The Gold layer also contains data-quality views:
gold.data_quality_row_countsgold.data_quality_summarygold.data_quality_field_issues
These views help monitor data retention, duplicate reduction, and field-level data-quality problems.
gold.executive_summary
Provides high-level warehouse KPIs including:
- Total developers
- Total repositories
- Total commits
- Total pull requests
- Merged pull requests
- Total issues
- Resolved issues
- Total releases
- Total stars
- Total forks
- Total organizations
- Average commits per active developer
- Overall pull request merge rate
- Overall issue closure rate
The SQL-Analysis/ directory contains analytical SQL scripts organized
by business area.
| Analysis | Purpose |
|---|---|
| Developer Productivity | Developer contribution and productivity analysis |
| Commit Analytics | Commit activity and code contribution analysis |
| Pull Request Analytics | Pull request and review performance |
| Issue Analytics | Issue resolution and project maintenance |
| Release Analytics | Release frequency and release-cycle analysis |
| Organization Analytics | Organization-level activity |
| Programming Language Analytics | Technology adoption |
| Community Engagement | Stars, forks, followers, and contributor activity |
| Data Quality Analytics | Data validation and quality analysis |
| Executive Summary Analysis | High-level GitHub engineering KPIs |
These queries use PostgreSQL features such as:
JOINGROUP BYHAVINGCASEFILTERCTEWindow FunctionsRanking FunctionsSubqueriesAggregationsViewsDate and time functions
Data quality is treated as an important part of the ETL process.
The project intentionally simulates issues such as:
- Missing values
- Duplicate records
- Invalid email addresses
- Negative numeric values
- Invalid relationships
- Inconsistent values
- Invalid foreign-key references
The Silver layer applies cleaning and validation rules before the data reaches the Gold layer.
Examples of validation include:
- Email format validation
- Missing-value detection
- Negative-value detection
- Duplicate detection
- Referential integrity validation
- Standardization of values
- Data retention measurement
The Tests/ directory contains SQL-based validation scripts.
Test_Bronze.sql
Validates raw Bronze-layer tables.
Test_Silver.sql
Validates cleaned and standardized Silver data.
Test_Gold.sql
Validates Gold-layer dimensions, facts, and analytical structures.
Test_Data_Integrity.sql
Validates:
- Primary keys
- Foreign keys
- Referential integrity
- Relationships between entities
Test_Business_Logic.sql
Validates analytical rules and expected business calculations.
| Category | Technology |
|---|---|
| Programming Language | Python |
| Database | PostgreSQL |
| SQL | Advanced PostgreSQL SQL |
| Data Processing | Pandas / Python |
| Data Generation | Python |
| ETL | Python + PostgreSQL |
| Data Warehouse Architecture | Medallion Architecture |
| Data Modeling | Dimensional Modeling |
| Database Connectivity | psycopg2 |
| Version Control | Git / GitHub |
| Testing | SQL-based validation |
| Documentation | Markdown |
git clone https://github.com/Harsh-Belekar/GitHub-Analytics-Database.git
cd GitHub-Analytics-Databasepython -m venv venv
venv\Scripts\activatepython3 -m venv venv
source venv/bin/activatepip install -r requirements.txtUpdate the database configuration in the Python scripts with your PostgreSQL credentials.
Example:
DB_NAME = "GitHub-Data-Warehouse"
DB_USER = "postgres"
DB_PASSWORD = "your_password"
DB_HOST = "localhost"
DB_PORT = "5432"A typical end-to-end execution sequence is:
Run:
python Data_Generator/Main.pyThis generates the raw GitHub datasets.
Run:
python ETL/Python-Scripts/Init_database.pyCreate Bronze tables:
python ETL/Python-Scripts/Bronze/DDL_Bronze.pyLoad raw data:
python ETL/Python-Scripts/Bronze/Load_Bronze.pyCreate Silver tables:
python ETL/Python-Scripts/Silver/DDL_Silver.pyApply cleaning and transformations:
python ETL/Python-Scripts/Silver/Cleaning_Functions.pyLoad Silver data:
python ETL/Python-Scripts/Silver/Load_Silver.pyCreate Gold tables:
python ETL/Python-Scripts/Gold/DDL_Gold.pyLoad Gold data:
python ETL/Python-Scripts/Gold/Load_Gold.pyCreate reporting views:
python ETL/Python-Scripts/Gold/Gold_Reporting_Views.pyExecute the SQL scripts inside:
Tests/
Execute the required analysis scripts from:
SQL-Analysis/
The project also contains SQL equivalents of the ETL operations.
The SQL workflow is:
Init_database.sql
│
▼
DDL_Bronze.sql
│
▼
Proc_Load_Bronze.sql
│
▼
DDL_Silver.sql
│
▼
Cleaning_Functions.sql
│
▼
Proc_Load_Silver.sql
│
▼
DDL_Gold.sql
│
▼
Proc_Load_Gold.sql
│
▼
Gold_Reporting_Views.sql
│
▼
SQL Analysis
This provides two implementation approaches:
- Python-driven ETL
- PostgreSQL SQL-driven ETL
The Docs/ directory contains the project's technical and business
documentation.
| Document | Description |
|---|---|
| Business_Problem.md | Defines the business problem, scope, users, benefits, and success criteria |
| Objectives.md | Defines technical, analytical, learning, and portfolio objectives |
| Business_Questions.md | Defines the analytical questions the warehouse should answer |
| Entity_Identification.md | Identifies the major GitHub entities |
| Relationship_Design.md | Defines relationships between entities |
| Data_Generation_Documentation.md | Documents synthetic data-generation methodology |
| Data_Catalog.md | Documents tables, columns, and data definitions |
The completed project demonstrates the ability to:
- Build a PostgreSQL analytical database from the ground up.
- Design interconnected relational and dimensional data models.
- Generate realistic synthetic datasets.
- Implement an end-to-end Medallion Architecture.
- Develop reusable Python ETL components.
- Develop PostgreSQL SQL-based ETL processes.
- Perform data cleaning and standardization.
- Implement data-quality validation.
- Build fact and dimension tables.
- Create business-ready analytical views.
- Apply advanced SQL techniques to real-world analytical problems.
- Validate data integrity and business logic.
- Organize a production-inspired data engineering repository.
- Document the complete data warehouse lifecycle.
Possible future improvements include:
- Incremental ETL processing.
- Slowly Changing Dimensions (SCD).
- Query-performance benchmarking.
- Index optimization.
- Partitioning for large fact tables.
- Automated ETL scheduling.
- CI/CD-based data-quality testing.
- Real GitHub API ingestion.
- Cloud data warehouse deployment.
- Additional GitHub entities and metrics.
These are potential extensions and are not part of the current project scope.
All datasets used in this project are dummy, synthetic, or public — generated programmatically using Python for learning and portfolio demonstration purposes only.
No real customer data, restaurant data, or proprietary Samsung information has been used. This project is not affiliated with, endorsed by, or connected to Samsung in any way.
👤 Harsh Belekar
📍 Data Analyst | Python Developer | SQL | Power BI | Excel | Data Visualization
📬 LinkedIn | 🔗GitHub
⭐ If you found this project helpful, feel free to star the repo and connect with me for collaboration!
Made with ❤️ and a lot of ☕ by Harsh Belekar

