rendercv.data.models.curriculum_vitae
¶
The rendercv.data.models.curriculum_vitae
module contains the data model of the cv
field of the input file.
SectionBase
¶
Bases: RenderCVBaseModelWithoutExtraKeys
This class is the parent class of all the section types. It is being used
in RenderCV internally, and it is not meant to be used directly by the users.
It is used by rendercv.data_models.utilities.create_a_section_model
function to
create a section model based on any entry type.
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
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
validate_url(url)
¶
Validate a URL.
Parameters:
-
url
(str
) –The URL to validate.
Returns:
-
str
–The validated URL.
create_a_section_validator(entry_type)
¶
Create a section model based on the entry type. See Pydantic's documentation about dynamic model creation for more information.
The section model is used to validate a section.
Parameters:
-
entry_type
(type
) –The entry type to create the section model. It's not an instance of the entry type, but the entry type itself.
Returns:
-
type[SectionBase]
–The section validator (a Pydantic model).
Source code in rendercv/data/models/curriculum_vitae.py
get_characteristic_entry_attributes(entry_types)
¶
Get the characteristic attributes of the entry types.
Parameters:
-
entry_types
(list[type]
) –The entry types to get their characteristic attributes. These are not instances of the entry types, but the entry types themselves.
str
type should not be included in this list.
Returns:
-
dict[type, set[str]]
–The characteristic attributes of the entry types.
Source code in rendercv/data/models/curriculum_vitae.py
get_entry_type_name_and_section_validator(entry, entry_types)
¶
Get the entry type name and the section validator based on the entry.
It takes an entry (as a dictionary or a string) and a list of entry types. Then it determines the entry type and creates a section validator based on the entry type.
Parameters:
-
entry
(dict[str, str | list[str]] | str | type
) –The entry to determine its type.
-
entry_types
(list[type]
) –The entry types to determine the entry type. These are not instances of the entry types, but the entry types themselves.
str
type should not be included in this list.
Returns:
-
tuple[str, type[SectionBase]]
–The entry type name and the section validator.
Source code in rendercv/data/models/curriculum_vitae.py
validate_a_section(sections_input, entry_types)
¶
Validate a list of entries (a section) based on the entry types.
Sections input is a list of entries. Since there are multiple entry types, it is not
possible to validate it directly. Firstly, the entry type is determined with the
get_entry_type_name_and_section_validator
function. If the entry type cannot be
determined, an error is raised. If the entry type is determined, the rest of the
list is validated with the section validator.
Parameters:
-
sections_input
(list[Any]
) –The sections input to validate.
-
entry_types
(list[type]
) –The entry types to determine the entry type. These are not instances of the entry types, but the entry types themselves.
str
type should not be included in this list.
Returns:
-
list[Entry]
–The validated sections input.
Source code in rendercv/data/models/curriculum_vitae.py
validate_a_social_network_username(username, network)
¶
Check if the username
field in the SocialNetwork
model is provided correctly.
Parameters:
-
username
(str
) –The username to validate.
Returns:
-
str
–The validated username.