vcf_to_obsidian.filename_generator

Filename Generator module for creating output filenames from VCF data.

Classes

FilenameGenerator

Class responsible for generating output filenames from vCard objects.

Module Contents

class vcf_to_obsidian.filename_generator.FilenameGenerator[source]

Class responsible for generating output filenames from vCard objects.

generate_filename(vcard, vcf_path)[source]

Generate an output filename based on vCard data with priority logic.

Priority: 1. Full Name (FN) field 2. Constructed name from given + family names 3. UID field 4. Original VCF filename

Parameters:
  • vcard – vobject vCard object

  • vcf_path (Path) – Original VCF file path

Returns:

Safe filename (without extension)

Return type:

str

_clean_filename(filename)[source]

Clean a filename to make it filesystem-safe.

Parameters:

filename (str) – Original filename

Returns:

Cleaned filename safe for filesystem use

Return type:

str

find_existing_files_with_uid(output_dir, uid)[source]

Find existing Markdown files in output directory that have the same UID.

Parameters:
  • output_dir (Path) – Output directory to search

  • uid (str) – UID to search for

Returns:

List of Path objects for files with matching UID

Return type:

list