Added a script that can conver vcf contacts file to excle, which then you can edit as you wish to edit in excle#547
Open
shaun2006 wants to merge 1 commit intowasmerio:mainfrom
Open
Added a script that can conver vcf contacts file to excle, which then you can edit as you wish to edit in excle#547shaun2006 wants to merge 1 commit intowasmerio:mainfrom
shaun2006 wants to merge 1 commit intowasmerio:mainfrom
Conversation
… you can edit as you want to
yooung1
reviewed
Feb 16, 2026
|
|
||
| for line in file: | ||
| line = line.strip() | ||
|
|
There was a problem hiding this comment.
for line in file:
line = line.strip()
match line:
case line.startswith("BEGIN:VCARD"):
contact = {}
case line.startswith("FN:"):
contact["Full Name"] = line.replace("FN:", "")
case line.startswith("TEL"):
phone = line.split(":")[-1]
contact.setdefault("Phone Numbers", []).append(phone)
case line.startswith("EMAIL"):
email = line.split(":")[-1]
contact.setdefault("Emails", []).append(email)
case line.startswith("ORG:"):
contact["Organization"] = line.replace("ORG:", "")
case line.startswith("ADR"):
address = line.split(":")[-1].replace(";", " ")
contact["Address"] = address
case line.startswith("END:VCARD"):
contact["Phone Numbers"] = ", ".join(contact.get("Phone Numbers", []))
contact["Emails"] = ", ".join(contact.get("Emails", []))
contacts.append(contact)
case _:
continue
There was a problem hiding this comment.
it's better if you use switch-case instead of if and elifs
yooung1
reviewed
Feb 16, 2026
|
|
||
| for line in file: | ||
| line = line.strip() | ||
|
|
There was a problem hiding this comment.
it's better if you use switch-case instead of if and elifs
| df = pd.DataFrame(contacts) | ||
| df.to_excel(output_file, index=False) | ||
|
|
||
| print(f"✅ Conversion complete! Saved as {output_file}") |
There was a problem hiding this comment.
it's not good to use emojis in prints
print(f"Conversion complete! Saved as {output_file}")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Title
Add VCF to Excel Converter Script with CLI Support and Documentation
Summary
This PR adds a Python script that converts VCF (vCard) files to Excel (.xlsx) format and includes command-line argument support along with a README file for usage instructions.
Description
This pull request introduces a new utility script
vcf_to_excel.pythat parses VCF files and converts contact data into an Excel spreadsheet.The script supports command-line usage with optional output file naming using the
-oflag. If no output file is provided, the script automatically generates an Excel file with the same base name as the input VCF file.Additionally, a README.md file has been added to document installation steps, usage instructions, and extracted fields.
The goal of this PR is to provide a simple, clean, and user-friendly solution for converting contact files into a structured Excel format.
The changes are as follows:
vcf_to_excel.pyscriptChecks
in the repository
in the PR
Thank You,
[Shaun Babar]