This Python script automates cleaning and enriching an Excel sheet of restaurant data. It removes duplicates, formats phone numbers, and generates Instagram search links based on restaurant names.
-
✅ Duplicate Removal
- Removes rows where both restaurant name and phone number are the same
- Highlights partial duplicates (same name or same phone only) in bold red
-
📞 Phone Number Formatting
- Ensures all numbers follow US format:
+1 (808)-XXX-XXXX - Fixes common formatting issues and sets column to "Text" to avoid Excel auto-formatting
- Ensures all numbers follow US format:
-
🔗 Instagram Link Generation
- Uses Google Search syntax to find Instagram pages related to the restaurant name
- Example:
https://www.google.com/search?q=Kono's+Northshore+hawaii+site:instagram.com - Adds links as clickable hyperlinks in Excel
-
🧠 Smart Menu Interface
-
Press
Enterto run all smart functions -
Or select:
[1]Generate Instagram links only[2]Remove duplicates only[3]Improve phone number formatting only[0]Export results tooutput.xlsx
-
-
🔄 Overwrite-Safe Export
- Replaces existing
output.xlsxif present
- Replaces existing
smart_restaurant_processor.py– main scriptinput.xlsx– input data (must be present)output.xlsx– generated resultrequirements.txt– dependencies
pip install -r requirements.txtpandas
openpyxl
tqdm
phonenumbersPlace input.xlsx in the same folder. Then run:
python smart_restaurant_processor.pyFollow the menu prompts to clean, enhance, and export your Excel data.
- Instagram links are search-based for reliability
- Phone formatting assumes US numbers (Hawaii = 808)
- Script supports Windows and macOS/Linux terminal clearing
Feel free to customize and extend this script to add:
- Verified Instagram scraping via SerpAPI or browser automation
- Export logs or summary reports
- Auto-open output on completion
© 2025 TableTurnerr | Hashaam Zahid