summaryrefslogtreecommitdiff
path: root/resume.py
blob: 3da5a51d4ae202bfd623bf82fb4a2266b5b3f77a (plain) (blame)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import json
import shutil
shutil.copyfile('template.tex', 'Yun_Joshua_Resume.tex')
f = open('resume.json')

experiences = json.load(f)
list_of_experiences = []
keys = list(experiences.keys())
f.close()


def max (input):
    max = 0
    for i in input:
        if i > max:
            max = i

    return max

def choose(list_of_choices):
    while True:
        try:
            choices = list(map(int,list(input("Select your choices: ").split())))
            if len(choices) > len(list_of_choices):
                print("Invalid Input, Try again")
                continue
            if max(choices) >= len(list_of_choices):
                print("Invalid Input, Try again")
                continue
        except ValueError:
            print("Invalid Input, Try again")
            continue
        return choices


for count, key in enumerate(keys):
    list_of_experiences.append(key)
    print(f"Choice {count}: {experiences[key]['title']}" )

choices = choose(list_of_experiences)

selected_experiences = []
print("\nYou have selected:")
for choice in choices:
    selected_experiences.append(keys[choice])
    print(experiences[list_of_experiences[choice]]['title'])

print("\n")

resume = open("Yun_Joshua_Resume.tex", "a")
resume.write('\n')
for experience in selected_experiences:
    # TODO: Write title and date to latex

    resume.write(f"{{\\large\\textbf{{{experiences[experience]['title']}}}}} \\hfill {experiences[experience]['date']}\n")
    print(f"Select your bullet points for: {experiences[experience]['title']}")
    list_of_bullet_points = []
    bullet_points = experiences[experience]
    bullet_keys = list(bullet_points.keys())
    count = 0
    for bullet in bullet_keys:
        if bullet == 'title' or bullet == 'date':
            continue
        else:
            list_of_bullet_points.append(bullet_points[bullet])
            print(f"Number {count}: {bullet_points[bullet]}")
            count = count + 1

    bullet_choice = choose(list_of_bullet_points)

    selected_bullets = []
    print("\nYou have selected:")
    resume.write("\\begin{itemize}[noitemsep]\n")
    for choice in bullet_choice:
        selected_bullets.append(bullet_keys[choice])
        resume.write(f"\\item {list_of_bullet_points[choice]}\n")
        print(list_of_bullet_points[choice])
        # TODO: Write this bullet point to latex
    print("\n")
    resume.write("\\end{itemize}\n")

resume.write("\\end{document}\n")
resume.close()