summaryrefslogtreecommitdiff
path: root/resume.py
diff options
context:
space:
mode:
authorJoshua Yun <joshua@joshuayun.com>2022-04-06 17:43:50 -0500
committerJoshua Yun <joshua@joshuayun.com>2022-04-06 17:43:50 -0500
commit77583eca73bb7f386d6466414e150794578326df (patch)
tree0bfb59772a63a6bf7036e796e2625f64ed614641 /resume.py
downloadautoresume-master.tar.gz
initial commitHEADmaster
Diffstat (limited to 'resume.py')
-rw-r--r--resume.py83
1 files changed, 83 insertions, 0 deletions
diff --git a/resume.py b/resume.py
new file mode 100644
index 0000000..3da5a51
--- /dev/null
+++ b/resume.py
@@ -0,0 +1,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()