This Python script provides functionality to convert vCard (.vcf
) files into CSV files, enabling easier management of contact data.
-
Fix vCard files: The script handles vCard files that split long lines across multiple lines with an equals sign (
=
). It combines these lines into a single line in a new vCard file. -
Convert vCard to CSV: The script reads the fixed vCard file and writes the contact information into a CSV file. The CSV file includes columns for the contact's name, email address, phone number, and any other fields present in the vCard file.
- Make sure you have the required Python packages installed by running:
pip install vobject quopri chardet
- Run the script in a Python environment:
python vcf2csv.py
- The script is currently hardcoded to process specific files. Consider modifying it to accept user input or command-line arguments for the filenames.
- The script uses the
ISO-8859-9
encoding to handle Turkish characters. If the vCard file contains characters from different languages, you may need to adjust the encoding. - The script currently ignores photos in the vCard file. If your vCard files include photos and you want to process them, you will need to extend the script.
- The script assumes that fields like name, email, and phone number exist in the vCard file and are of a certain type. If your vCard files have different fields or data types, you may need to adjust the script.
Generated by GPT-4