bewerbung_generator module

Bewerbung Generator - Generates German job applications from profiles and job descriptions

class bewerbung_generator.BewerbungGenerator(base_dir='.')[source]

Bases: object

__init__(base_dir='.')[source]
setup_logging(output_dir)[source]

Setup structured logging for the generation process

Return type:

Logger

get_newest_file_by_date_pattern(directory, pattern='(\\\\d{8})_.*')[source]

Find the newest file in directory based on YYYYMMDD date pattern

Return type:

Optional[Path]

read_newest_profile()[source]

Step 1: Read the newest profile file from profil/ directory

Return type:

Optional[Path]

read_newest_job_description()[source]

Step 2: Read the newest job description from Stellenbeschreibung/ directory

Return type:

Optional[Path]

extract_file_identifiers(profile_file, job_file)[source]

Extract date and identifier parts from profile and job filenames Returns: (profile_date, profile_id, job_date, job_id)

Return type:

Tuple[str, str, str, str]

create_output_directory(profile_file, job_file)[source]

Step 3: Create output directory with proper naming pattern Pattern: {job_date}_{job_id}-{profile_date}_{profile_id}

Return type:

Path

generate_application_documents(output_dir, profile_file, job_file)[source]

Step 4: Generate application documents (cover letter, CV, attachments) with AI content

Parameters:
  • output_dir (Path) – Directory for generated documents

  • profile_file (Path) – Path to profile file

  • job_file (Path) – Path to job description file

Return type:

Dict[str, Path]

create_pdf_directory(output_dir)[source]

Step 5: Create pdf/ subdirectory in output directory(ies)

Return type:

Path

convert_documents_to_pdf(markdown_files, pdf_dir)[source]

Step 6: Convert documents to PDF format in all relevant directories

Return type:

Dict[str, Path]

bewerbung_generator.main()[source]

Main orchestration script - executes all 7 steps of the application generation process

Classes

class bewerbung_generator.BewerbungGenerator(base_dir='.')[source]
__init__(base_dir='.')[source]
setup_logging(output_dir)[source]

Setup structured logging for the generation process

Return type:

Logger

get_newest_file_by_date_pattern(directory, pattern='(\\\\d{8})_.*')[source]

Find the newest file in directory based on YYYYMMDD date pattern

Return type:

Optional[Path]

read_newest_profile()[source]

Step 1: Read the newest profile file from profil/ directory

Return type:

Optional[Path]

read_newest_job_description()[source]

Step 2: Read the newest job description from Stellenbeschreibung/ directory

Return type:

Optional[Path]

extract_file_identifiers(profile_file, job_file)[source]

Extract date and identifier parts from profile and job filenames Returns: (profile_date, profile_id, job_date, job_id)

Return type:

Tuple[str, str, str, str]

create_output_directory(profile_file, job_file)[source]

Step 3: Create output directory with proper naming pattern Pattern: {job_date}_{job_id}-{profile_date}_{profile_id}

Return type:

Path

generate_application_documents(output_dir, profile_file, job_file)[source]

Step 4: Generate application documents (cover letter, CV, attachments) with AI content

Parameters:
  • output_dir (Path) – Directory for generated documents

  • profile_file (Path) – Path to profile file

  • job_file (Path) – Path to job description file

Return type:

Dict[str, Path]

create_pdf_directory(output_dir)[source]

Step 5: Create pdf/ subdirectory in output directory(ies)

Return type:

Path

convert_documents_to_pdf(markdown_files, pdf_dir)[source]

Step 6: Convert documents to PDF format in all relevant directories

Return type:

Dict[str, Path]

Methods

Core Workflow Methods

BewerbungGenerator.read_newest_profile()[source]

Step 1: Read the newest profile file from profil/ directory

Return type:

Optional[Path]

BewerbungGenerator.read_newest_job_description()[source]

Step 2: Read the newest job description from Stellenbeschreibung/ directory

Return type:

Optional[Path]

BewerbungGenerator.create_output_directory(profile_file, job_file)[source]

Step 3: Create output directory with proper naming pattern Pattern: {job_date}_{job_id}-{profile_date}_{profile_id}

Return type:

Path

BewerbungGenerator.generate_application_documents(output_dir, profile_file, job_file)[source]

Step 4: Generate application documents (cover letter, CV, attachments) with AI content

Parameters:
  • output_dir (Path) – Directory for generated documents

  • profile_file (Path) – Path to profile file

  • job_file (Path) – Path to job description file

Return type:

Dict[str, Path]

BewerbungGenerator.create_pdf_directory(output_dir)[source]

Step 5: Create pdf/ subdirectory in output directory(ies)

Return type:

Path

Utility Methods

BewerbungGenerator.get_newest_file_by_date_pattern(directory, pattern='(\\\\d{8})_.*')[source]

Find the newest file in directory based on YYYYMMDD date pattern

Return type:

Optional[Path]

Usage Example

from bewerbung_generator import BewerbungGenerator

# Initialize generator
generator = BewerbungGenerator(base_dir=".")

# Run complete workflow
result = generator.run()

if result:
    print("✅ Application generated successfully")
else:
    print("❌ Generation failed")