rendercv.data.reader
¶
The rendercv.data.reader
module contains the functions that are used to read the input
file (YAML or JSON) and return them as an instance of RenderCVDataModel
, which is a
Pydantic data model of RenderCV's data format.
read_a_yaml_file(file_path_or_contents)
¶
Read a YAML file and return its content as a dictionary. The YAML file can be given as a path to the file or as the contents of the file as a string.
Parameters:
-
file_path_or_contents
(Path | str
) –The path to the YAML file or the contents of the YAML file as a string.
Returns:
-
dict
–The content of the YAML file as a dictionary.
Source code in rendercv/data/reader.py
validate_input_dictionary_and_return_the_data_model(input_dictionary)
¶
Validate the input dictionary by creating an instance of RenderCVDataModel
,
which is a Pydantic data model of RenderCV's data format.
Parameters:
-
input_dictionary
(dict
) –The input dictionary.
Returns:
-
RenderCVDataModel
–The data model.
Source code in rendercv/data/reader.py
read_input_file(file_path_or_contents)
¶
Read the input file (YAML or JSON) and return them as an instance of
RenderCVDataModel
, which is a Pydantic data model of RenderCV's data format.
Parameters:
-
file_path_or_contents
(Path | str
) –The path to the input file or the contents of the input file as a string.
Returns:
-
RenderCVDataModel
–The data model.