Add dynamic qualification content

This commit is contained in:
Marty Oehme 2023-06-22 18:03:59 +02:00
parent 14be4ea1ca
commit a1d41cc2ac
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
4 changed files with 57 additions and 2 deletions

View file

@ -1,5 +1,6 @@
from typing import Any
def summary_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""):
if "summary" not in data:
return
@ -7,6 +8,7 @@ def summary_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""):
return md
def experience_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""):
if "experience" not in data:
return
@ -19,10 +21,11 @@ def experience_to_md(data: dict[str, Any], lang: str = "en", headline: str = "")
md += f"> {exp['publication'][lang]}\n\n"
for point in exp["bullets"]:
md+=f"* {point[lang]}\n"
md += f"* {point[lang]}\n"
return md
def education_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""):
if "education" not in data:
return
@ -30,7 +33,21 @@ def education_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""):
md = f"{headline}\n\n"
for edu in data["education"]:
md += (
f"{edu['place'][lang]}\n\n: {edu['program'][lang]};{edu['date'][lang]}\n\n"
f"{edu['place'][lang]}\n\n: {edu['program'][lang]}; {edu['date'][lang]}\n\n"
)
return md
def qualifications_to_md(data: dict[str, Any], lang: str = "en", headline: str = ""):
if "skills" not in data:
return
md = f"{headline}\n\n"
for skillset in data["skills"]:
md += f"{skillset[lang]}\n\n"
for content in skillset["content"]:
md += f": {content['name'][lang]} ({', '.join([item[lang] for item in content['items']])})\n"
md += "\n"
return md