-
Notifications
You must be signed in to change notification settings - Fork 0
/
cv-o-matic.py
65 lines (55 loc) · 1.97 KB
/
cv-o-matic.py
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env python3
# CV-O-MATIC
# By: Kristin Muench
# Created: 25 09 2023
# Last Updated: 25 09 2023
#
# # # # # # # # # # # # #
#
# This is a Python script that takes a CSV database of professional attributes as input
# and generates a LaTeX document for further use.
#
# # # # # # # # # # # # #
import click
import os
from utils.latex_template import *
from utils.generate_content_dicts import make_paper_dict, make_experience_dict, make_education_dict, make_skills_dict, make_summary
@click.command()
@click.option(
"-o",
"--output_dir",
type=str,
help="Output directory where latex draft should be output"
)
@click.option(
"-c",
"--content_dir",
type=str,
help="Input directory containing csv files with content that should be used to populate CV"
)
@click.option(
"-k",
"--keyword",
type=str,
help="string to prepend CV file name to help keep track of versions"
)
def main(output_dir, content_dir, keyword):
os.makedirs(output_dir, exist_ok=True)
output_file=os.path.join(output_dir, keyword + '_cv.tex')
# generate content
papers_dict = make_paper_dict(content_dir)
experiences_dict_list, addl_experiences_dict_list = make_experience_dict(content_dir)
education_dict_list = make_education_dict(content_dir)
skills_dict = make_skills_dict(content_dir)
summary = make_summary(content_dir)
# generate file
with open(os.path.join(output_dir, 'papers.bib'),'w') as b:
b.write(create_bib_file(papers_dict))
with open(output_file, 'w') as f:
f.write(generate_latex_template_text(FULL_NAME, MY_ADDRESS, MY_CITY, MY_COUNTRY, MY_LINKEDIN,
MY_GITHUB, MY_EMAIL, MY_PHONE_NUMBER,
summary,
papers_dict, experiences_dict_list, addl_experiences_dict_list,
education_dict_list, skills_dict))
if __name__ == "__main__":
main()