The Data Redundancy Removal System is a Python command-line application that solves a critical data quality problem: when new records are being added to a cloud database, how do you ensure no duplicates, near-duplicates, or false positives contaminate the dataset?
The system reads incoming CSV data, validates each record against existing database records using two detection methods (hash-based and similarity-based), classifies each record into one of four categories, and only inserts records that are genuinely new and unique.
Input: new_customers.csv
|
v
[VALIDATION ENGINE]
|
|-- Step 1: Generate SHA-256 hash (email + phone)
|-- Step 2: Check hash against database
|-- Step 3: Check email against database
|-- Step 4: Calculate name/email/phone similarity scores
|-- Step 5: Classify the record
|
v
[CLASSIFICATION]
|
UNIQUE -----> INSERT into database
FALSE_POSITIVE --> INSERT into database
EXACT_DUPLICATE --> REJECT + LOG
NEAR_DUPLICATE --> REJECT + LOG
|
v
[REPORT GENERATOR]
|
v
Output: reports/redundancy_report_TIMESTAMP.csv
| Tool | Purpose |
|---|---|
| Python 3.11 | Core system language |
| SQLAlchemy | Database ORM and connection management |
| SQLite | Local development database |
| AWS RDS MySQL | Production cloud database |
| hashlib SHA-256 | Exact duplicate detection via hashing |
| difflib SequenceMatcher | Near-duplicate similarity scoring |
| argparse | Command line interface |
| CSV module | Reading input and writing reports |
| logging | Full audit trail of all operations |
Goal: Create the full project folder structure in VS Code.