rendercv/run_rendercv.py

31 lines
710 B
Python
Raw Normal View History

2023-09-10 19:54:36 +00:00
"""
This module is a script to run the RenderCV and generate a CV as a PDF.
"""
2023-09-09 15:25:28 +00:00
import os
import logging
from ruamel.yaml import YAML
from rendercv.data_model import RenderCVDataModel
2023-09-12 17:41:56 +00:00
from rendercv.rendering import render_template, run_latex
2023-09-09 15:25:28 +00:00
2023-09-10 19:54:36 +00:00
# logging config:
logging.basicConfig(
level=logging.DEBUG,
format="%(name)s - %(levelname)s - %(message)s",
)
2023-09-12 17:41:56 +00:00
input_name = "personal"
2023-10-07 18:07:57 +00:00
workspace = os.path.dirname(__file__)
2023-09-10 19:54:36 +00:00
2023-09-12 17:41:56 +00:00
input_file_path = os.path.join(workspace, "tests", "inputs", f"{input_name}.yaml")
2023-09-10 19:54:36 +00:00
with open(input_file_path) as file:
yaml = YAML()
raw_json = yaml.load(file)
data = RenderCVDataModel(**raw_json)
2023-09-13 17:10:21 +00:00
output_latex_file=render_template(data=data)
2023-09-10 19:54:36 +00:00
2023-09-13 17:10:21 +00:00
run_latex(output_latex_file)