scripts: add contact-to-vcf converter with deduplication#161
Open
KJ7LNW wants to merge 1 commit into
Open
Conversation
5 tasks
libpff exports one Contact.txt per item, leading to duplicate records when processing large mailbox archives. This script reads a list of Contact.txt paths from stdin, merges duplicates keyed on primary email or display name, and emits a single vCard 3.0 .vcf file to stdout. - parse Contact.txt fields into a structured dict per file - filter Exchange internal addresses (/o=) from email fields - key contacts on first real email, falling back to display name - accumulate phones and emails when merging duplicate keys - map phone label substrings to vCard TEL type tokens - emit vCard 3.0 blocks with proper value escaping - report input/error/skip/merge/unique tallies to stderr Signed-off-by: Eric Wheeler <git-default@z.ewheeler.org>
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.
Description
libpffexports oneContact.txtper item, producing duplicate records across large mailbox archives. This adds a converter that merges those records into a single vCard.vcffile.Type of Change
Implementation Details
A standalone script reads
Contact.txtpaths from stdin, parses each into a structured record, deduplicates, and emits vCard 3.0 to stdout./o=) from email fieldsTELtype tokens