This project is a Python script designed to clean and deduplicate contacts from a VCF (vCard) file.
- Scan VCF Fields: Identifies all unique fields in the VCF file.
- Parse VCF File: Parses the VCF file and creates a DataFrame with the identified fields.
- Clean Notes Field: Removes specific unwanted lines from the notes field.
- Find Duplicates: Identifies potential duplicate contacts based on name and other relevant fields.
- Interactive Merge/Delete: Allows interactive merging or deletion of duplicate contacts.
- Save to CSV: Exports the cleaned contacts to a CSV file, excluding certain fields.
- Save to VCF: Saves the cleaned contacts to a new VCF file.
- Python 3.11
- tqdm
- pandas
- fuzzywuzzy
- vobject
- Clone the Repository:
git clone https://github.com/yourusername/contacts_cleaner.git cd contacts_cleaner
- Create and Activate the Conda Environment:
conda env create -f environment.yml conda activate contacts_cleaner
- Run The Script
python contacts_cleaner.py
-
To enable debug mode, which processes only the first 100 contacts for faster testing, set the
DEBUG
flag toTrue
in the script.DEBUG = False # Set to True to enable debug mode, which processes only the first 100 contacts for faster testing
- Open the Contacts app.
- Select the contacts you want to export.
- Tap Share Contact and choose the Mail option.
- Send the VCF file to your email address and download it.
- Open the Contacts app.
- Select the contacts you want to export.
- Go to File > Export > Export vCard.
- Save the VCF file to your desired location.
- Open Google Contacts.
- Select the contacts you want to export.
- Click on the More button (three vertical dots) and select Export.
- Choose the vCard (for iOS Contacts) option and click Export.
- Download the VCF file to your computer.
- Open Microsoft Outlook.
- Go to the People section.
- Select the contacts you want to export.
- Click on File > Open & Export > Import/Export.
- Choose Export to a file and select Comma Separated Values or vCard.
- Follow the prompts to export your contacts to a VCF file.