rendercv_model_builder
¶
BuildRendercvModelArguments
¶
Bases: TypedDict
design_yaml_file
instance-attribute
¶
dont_generate_html
instance-attribute
¶
dont_generate_markdown
instance-attribute
¶
dont_generate_pdf
instance-attribute
¶
dont_generate_png
instance-attribute
¶
dont_generate_typst
instance-attribute
¶
html_path
instance-attribute
¶
locale_yaml_file
instance-attribute
¶
markdown_path
instance-attribute
¶
output_folder
instance-attribute
¶
overrides
instance-attribute
¶
pdf_path
instance-attribute
¶
png_path
instance-attribute
¶
settings_yaml_file
instance-attribute
¶
typst_path
instance-attribute
¶
build_rendercv_dictionary(main_yaml_file, **kwargs)
¶
Merge main YAML with overlays and CLI overrides into final dictionary.
Parameters:
-
main_yaml_file(str) –Primary CV YAML content string.
-
kwargs(Unpack[BuildRendercvModelArguments], default:{}) –Optional YAML overlay strings, output paths, generation flags, and CLI overrides.
Returns:
-
tuple[CommentedMap, dict[str, CommentedMap]]–Tuple of merged dictionary and overlay source CommentedMaps (for error reporting).
Source code in src/rendercv/schema/rendercv_model_builder.py
build_rendercv_dictionary_and_model(main_yaml_file, *, input_file_path=None, **kwargs)
¶
Complete pipeline from raw YAML string to validated model.
Parameters:
-
main_yaml_file(str) –Primary CV YAML content string.
-
input_file_path(Path | None, default:None) –Source file path for validation context (path resolution).
-
kwargs(Unpack[BuildRendercvModelArguments], default:{}) –Optional YAML overlay strings, output paths, generation flags, and CLI overrides.
Returns:
-
tuple[CommentedMap, RenderCVModel]–Tuple of merged dictionary and validated model.
Source code in src/rendercv/schema/rendercv_model_builder.py
build_rendercv_model_from_commented_map(commented_map, input_file_path=None, overlay_sources=None)
¶
Validate merged dictionary and build Pydantic model with error mapping.
Parameters:
-
commented_map(CommentedMap | dict[str, Any]) –Merged dictionary with line/column metadata.
-
input_file_path(Path | None, default:None) –Source file path for context and photo resolution.
-
overlay_sources(dict[str, CommentedMap] | None, default:None) –Per-section CommentedMaps from overlays (for correct error coordinates).
Returns:
-
RenderCVModel–Validated RenderCVModel instance.
Source code in src/rendercv/schema/rendercv_model_builder.py
get_yaml_error_location(error)
¶
Extract 1-indexed line/column coordinates from ruamel parser errors.
Parameters:
-
error(YAMLError) –YAML parsing exception raised by ruamel.
Returns:
-
YamlLocation | None–Start/end coordinates when available, otherwise None.
Source code in src/rendercv/schema/rendercv_model_builder.py
read_yaml_with_validation_errors(yaml_content, yaml_source)
¶
Parse YAML content and convert parser failures into validation errors.
Why
YAML syntax errors should use the same error pipeline as schema validation, so the CLI can display all input issues through one consistent path.
Parameters:
-
yaml_content(str) –YAML string content.
-
yaml_source(YamlSource) –Which input file this YAML content came from.
Returns:
-
CommentedMap–Parsed YAML map preserving source coordinates.
Raises:
-
RenderCVUserValidationError–If YAML cannot be parsed.