-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
44 lines (31 loc) · 1.61 KB
/
main.py
File metadata and controls
44 lines (31 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from helper.job_parser import extract_job_description
from helper.resume_parser import parse_resume_sections
from helper.llm_interface import update_resume_with_llm, run_final_coherence_check
from helper.pdf_exporter import convert_md_to_pdf
import argparse
from pathlib import Path
def main():
parser = argparse.ArgumentParser(description="Tailor your resume to a specific job description.")
parser.add_argument('--job', required=True, help='Job description URL or path to a text file')
parser.add_argument('--resume', required=True, help='Path to the Markdown resume file')
parser.add_argument('--company', required=True, help='Company name to tag the output resume')
args = parser.parse_args()
# Step 1: Extract job description
job_description = extract_job_description(args.job)
# Step 2: Parse resume into sections
sections = parse_resume_sections(args.resume)
# Step 3: Update each section using the LLM
updated_sections = update_resume_with_llm(sections, job_description)
# Step 4: Combine sections and run final polish
updated_resume = "\n\n".join(updated_sections)
final_resume = run_final_coherence_check(updated_resume, job_description)
# Step 5: Save to Markdown file
output_md_path = f"{Path(args.resume).stem}_{args.company}.md"
with open(output_md_path, "w", encoding='utf-8') as f:
f.write(final_resume)
# Step 6: Convert to PDF
convert_md_to_pdf(output_md_path)
print(f"\n✅ Resume tailored and saved as: {output_md_path}")
print(f"📄 PDF generated as: {Path(output_md_path).stem}.pdf")
if __name__ == "__main__":
main()