feat: migrate data layer to SQLite database and add Education module#6
Open
Ayesha-Anwar607 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This PR migrates the data storage layer of
faker-pkfrom hardcoded Python lists/dictionaries to a packaged, serverless SQLite database (faker_pk.db), and introduces a new Education module with realistic student profiles and institution filtering.Key Improvements & Features Added
1. SQLite Database Storage Layer
industries,job_titles,companies,locations,names,sim_providers,sim_prefixes,castes,sects,banks,institutions) with proper foreign keys and constraints.faker_pk/utils.pyso that iffaker_pk.dbis missing, it automatically regenerates frominitialize_db.py.pyproject.tomlwith setuptoolspackage-dataconfiguration to natively package*.dbfiles inside wheels/tarballs.2. Enhanced Data Logic & Realistic Relational Queries
cnic(gender=...)generates CNICs ending with an odd digit for males and an even digit for females.phone_number(provider=...)pulls authentic mobile prefixes matching the specified telecom provider.full_address()generates real, city-matched Pakistani postal codes alongside province filtering incity()andprovince().iban(bank=...)generates valid Pakistani IBAN formats utilizing authentic 4-letter bank codes (e.g.MEZNfor Meezan Bank).3. New Education Module (
education.py)institution(level=..., city=..., province=...)generates schools, colleges, or universities filtered by level or location.student_dob(level=...)generates realistic birth dates matching institution age limits (5–14 for school, 14–18 for college, 18–25 for university).student_profile(level=..., province=...)generates a complete dictionary containing consistent gender, CNIC, institution, city, province, and age-appropriate DOB.Test Suite & Verification Results
tests/.test_realistic_combinations.pytesting CNIC gender alignment, address consistency, IBAN codes, SIM prefixes, and DB auto-initialization.============================= 41 passed in 0.69s ==============================