π« The Pain Point
Your contact list has phone numbers in 10 different formats: β0901234567β, β84-90-123-4567β, β+84 90 123 4567β, β090 123 4567β. You need them all standardized for SMS marketing.
π Agentic Solution
A Phone Number Normalizer that converts all formats to your standard.
Key Features:
- Format Options: E.164 (+84901234567), National (0901234567), Spaced.
- Validation: Check if numbers are valid.
- Country Detection: Auto-detect or force country code.
βοΈ Phase 1: Commander (Quick Fix)
For quick formatting.
Prompt:
βI have an Excel
contacts.xlsxwith column βPhoneβ containing Vietnamese phone numbers in various formats. Write a Python script using phonenumbers library to:
- Parse: Assume Vietnam (+84) if no country code.
- Format: Standardize to
84xxxxxxxxx(no plus, no spaces).- Validate: Mark invalid numbers in a new column.
- Output: Save as
contacts_fixed.xlsx.Print count of valid/invalid numbers.β
Result: Clean phone list ready for bulk SMS.
ποΈ Phase 2: Architect (Permanent Tool)
Engineering Prompt:
**Role:** Python Tool Developer
**Task:** Create a "Phone Number Formatter".
**Requirements:**
1. **GUI:**
* Select Excel file.
* Column picker.
* Country dropdown (default Vietnam).
* Output format dropdown.
* Preview valid/invalid.
2. **Logic:**
* Use phonenumbers library.
* Handle edge cases (landlines, mobile).
* Mark invalid without deleting.
3. **Deliverables:**
* `phone_fixer.py`
* `run.bat`, `run.sh`
* `requirements.txt`
π§ Prompt Decoding
- phonenumbers library: Googleβs library that handles all international formats.
π οΈ Instructions
- Install:
pip install phonenumbers - Copy Prompt β Run.