entry_with_complex_fields
¶
ExactDate = Annotated[str | int, pydantic.AfterValidator(validate_exact_date)]
¶
BaseEntryWithComplexFields
¶
Bases: BaseEntryWithDate
date = pydantic.Field(default=None, description="The date of this event in YYYY-MM-DD, YYYY-MM, or YYYY format, or any custom text like 'Fall 2023'. Use this for single-day or imprecise dates. For date ranges, use `start_date` and `end_date` instead.", examples=['2020-09-24', '2020-09', '2020', 'Fall 2023', 'Summer 2020'])
class-attribute
instance-attribute
¶
end_date = pydantic.Field(default=None, description='The end date in YYYY-MM-DD, YYYY-MM, or YYYY format. Use "present" for ongoing events, or omit it to indicate the event is ongoing.', examples=['2024-05-20', '2024-05', '2024', 'present'])
class-attribute
instance-attribute
¶
entry_type_in_snake_case
cached
property
¶
highlights = pydantic.Field(default=None, description='Bullet points for key achievements, responsibilities, or contributions.', examples=[['Increased system performance by 40% through optimization.', 'Mentored 3 junior developers and conducted code reviews.', 'Implemented CI/CD pipeline reducing deployment time by 60%.']])
class-attribute
instance-attribute
¶
location = pydantic.Field(default=None, examples=['Istanbul, Türkiye', 'New York, NY', 'Remote'])
class-attribute
instance-attribute
¶
model_config = pydantic.ConfigDict(json_schema_extra={'description': None})
class-attribute
instance-attribute
¶
start_date = pydantic.Field(default=None, description='The start date in YYYY-MM-DD, YYYY-MM, or YYYY format.', examples=['2020-09-24', '2020-09', '2020'])
class-attribute
instance-attribute
¶
summary = pydantic.Field(default=None, examples=['Led a team of 5 engineers to develop innovative solutions.', 'Completed advanced coursework in machine learning and artificial intelligence.'])
class-attribute
instance-attribute
¶
check_and_adjust_dates(info)
¶
Source code in src/rendercv/schema/models/cv/entries/bases/entry_with_complex_fields.py
get_date_object(date, current_date=None)
¶
Convert date string/int to Python Date object.
Why
Date arithmetic (start/end comparison, duration calculation) requires Python Date objects. This parser handles multiple formats including "present" keyword for ongoing positions.
Example
Parameters:
-
date(str | int) –Date in YYYY-MM-DD, YYYY-MM, YYYY format, or "present".
-
current_date(date | None, default:None) –Reference date for "present" keyword.
Returns:
-
date–Python Date object.
Source code in src/rendercv/schema/models/cv/entries/bases/entry_with_complex_fields.py
validate_exact_date(date)
¶
Validate date conforms to strict format requirements.
Why
start_date/end_date need strict formats for date arithmetic (calculating duration). Unlike arbitrary dates, these must parse to actual Date objects for comparison and duration rendering.
Parameters:
-
date(str | int) –Date value to validate.
Returns:
-
str | int–Original date if valid.