rendercv.data.models
¶
The rendercv.data.models
package contains all the Pydantic data models, validators,
and computed fields that are used in RenderCV. The package is divided into several
modules, each containing a different group of data models.
base.py
: ContainsRenderCVBaseModel
, which is the parent class of all the data models in RenderCV.computers.py
: Contains all the functions that are used to compute some values of the fields in the data models. For example, converting ISO dates to human-readable dates.entry_types.py
: Contains all the data models that are used to represent the entries in the CV.curriculum_vitae.py
: Contains theCurriculumVitae
data model, which is the main data model that contains all the content of the CV.design.py
: Contains the data model that is used to represent the design options of the CV.locale_catalog.py
: Contains the data model that is used to represent the locale catalog of the CV.rendercv_settings.py
: Contains the data model that is used to represent the settings of the RenderCV.rendercv_data_model.py
: Contains theRenderCVDataModel
data model, which is the main data model that defines the whole input file structure.
CurriculumVitae
¶
Bases: RenderCVBaseModelWithExtraKeys
This class is the data model of the cv
field.
Source code in rendercv/data/models/curriculum_vitae.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 |
|
connections: list[dict[str, Optional[str]]]
cached
property
¶
Return all the connections of the person as a list of dictionaries and cache
connections
as an attribute of the instance. The connections are used in the
header of the CV.
Returns:
-
list[dict[str, Optional[str]]]
–The connections of the person.
sections: list[SectionBase]
cached
property
¶
Compute the sections of the CV based on the input sections.
The original sections
input is a dictionary where the keys are the section titles
and the values are the list of entries in that section. This function converts the
input sections to a list of SectionBase
objects. This makes it easier to work with
the sections in the rest of the code.
Returns:
-
list[SectionBase]
–The computed sections.
update_curriculum_vitae(value, info)
classmethod
¶
Update the curriculum_vitae
dictionary.
Source code in rendercv/data/models/curriculum_vitae.py
SocialNetwork
¶
Bases: RenderCVBaseModelWithoutExtraKeys
This class is the data model of a social network.
Source code in rendercv/data/models/curriculum_vitae.py
url: str
cached
property
¶
Return the URL of the social network and cache url
as an attribute of the
instance.
check_username(username, info)
classmethod
¶
Check if the username is provided correctly.
Source code in rendercv/data/models/curriculum_vitae.py
check_url()
¶
Validate the URL of the social network.
Source code in rendercv/data/models/curriculum_vitae.py
BulletEntry
¶
Bases: RenderCVBaseModelWithExtraKeys
This class is the data model of BulletEntry
.
Source code in rendercv/data/models/entry_types.py
EducationEntry
¶
Bases: EntryBase
, EducationEntryBase
This class is the data model of EducationEntry
. EducationEntry
class is
created by combining the EntryBase
and EducationEntryBase
classes to have the
fields in the correct order.
Source code in rendercv/data/models/entry_types.py
ExperienceEntry
¶
Bases: EntryBase
, ExperienceEntryBase
This class is the data model of ExperienceEntry
. ExperienceEntry
class is
created by combining the EntryBase
and ExperienceEntryBase
classes to have the
fields in the correct order.
Source code in rendercv/data/models/entry_types.py
NormalEntry
¶
Bases: EntryBase
, NormalEntryBase
This class is the data model of NormalEntry
. NormalEntry
class is created by
combining the EntryBase
and NormalEntryBase
classes to have the fields in the
correct order.
Source code in rendercv/data/models/entry_types.py
OneLineEntry
¶
Bases: RenderCVBaseModelWithExtraKeys
This class is the data model of OneLineEntry
.
Source code in rendercv/data/models/entry_types.py
PublicationEntry
¶
Bases: EntryWithDate
, PublicationEntryBase
This class is the data model of PublicationEntry
. PublicationEntry
class is
created by combining the EntryWithDate
and PublicationEntryBase
classes to have
the fields in the correct order.
Source code in rendercv/data/models/entry_types.py
LocaleCatalog
¶
Bases: RenderCVBaseModelWithoutExtraKeys
This class is the data model of the locale catalog. The values of each field
updates the locale_catalog
dictionary.
Source code in rendercv/data/models/locale_catalog.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|
update_locale_catalog(value, info)
classmethod
¶
Update the locale_catalog
dictionary.
Source code in rendercv/data/models/locale_catalog.py
RenderCVDataModel
¶
Bases: RenderCVBaseModelWithoutExtraKeys
This class binds both the CV and the design information together.
Source code in rendercv/data/models/rendercv_data_model.py
update_paths(rendercv_settings, info)
classmethod
¶
Update the paths in the RenderCV settings.
Source code in rendercv/data/models/rendercv_data_model.py
initialize_locale_catalog(locale_catalog)
classmethod
¶
Even if the locale catalog is not provided, initialize it with the default values.
Source code in rendercv/data/models/rendercv_data_model.py
RenderCommandSettings
¶
Bases: RenderCVBaseModelWithoutExtraKeys
This class is the data model of the render
command's settings.
Source code in rendercv/data/models/rendercv_settings.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
|
replace_placeholders(value)
classmethod
¶
Replaces the placeholders in a string with the corresponding values.
Source code in rendercv/data/models/rendercv_settings.py
convert_string_to_path(value)
classmethod
¶
Converts a string to a pathlib.Path
object by replacing the placeholders
with the corresponding values. If the path is not an absolute path, it is
converted to an absolute path by prepending the current working directory.
Source code in rendercv/data/models/rendercv_settings.py
RenderCVSettings
¶
Bases: RenderCVBaseModelWithoutExtraKeys
This class is the data model of the RenderCV settings.
Source code in rendercv/data/models/rendercv_settings.py
format_date(date, date_style=None)
¶
Formats a Date
object to a string in the following format: "Jan 2021". The
month names are taken from the locale_catalog
dictionary from the
rendercv.data_models.models
module.
Parameters:
-
date
(date
) –The date to format.
-
date_style
(Optional[str]
, default:None
) –The style of the date string. If not provided, the default date style from the
locale_catalog
dictionary will be used.
Returns:
-
str
–The formatted date.