archaeo_super_prompt.dataset.normalization.intervention_date.transforms
source module archaeo_super_prompt.dataset.normalization.intervention_date.transforms
Transform functions.
Functions
-
get_day_period — Extract a precise date period from a string of 2 dates separated by an hyphen.
-
get_single_day_period — Extract a single date with a day.
-
get_month_period — Extract a month period from a string of 2 months separated by an hyphen.
-
get_single_month_period — Extract a single month period.
-
start_year — Extract a year, meaning a year when the intervention has started.
-
generic_period — Process a generic period of 2 dates separated by an hyphen.
-
generic_single_period — Process a single period with the day, month or year precision.
-
precised_numeric_start_date — Process a precise date in the format day/month/year.
-
before_day_month — Return only the most recent day before which the intervention could happen.
source get_day_period(row: InterventionDataForDateNormalizationRowSchema) → Date | None
Extract a precise date period from a string of 2 dates separated by an hyphen.
source get_single_day_period(row: InterventionDataForDateNormalizationRowSchema) → Date | None
Extract a single date with a day.
source get_month_period(row: InterventionDataForDateNormalizationRowSchema) → Date | None
Extract a month period from a string of 2 months separated by an hyphen.
source get_single_month_period(row: InterventionDataForDateNormalizationRowSchema) → Date | None
Extract a single month period.
source start_year(row: InterventionDataForDateNormalizationRowSchema) → Date | None
Extract a year, meaning a year when the intervention has started.
source generic_period(row: InterventionDataForDateNormalizationRowSchema) → Date | None
Process a generic period of 2 dates separated by an hyphen.
Notes
If 2 dates are given, usually it is not a window of time for the start of the intervention but the start and the end dates of the intervention.
source generic_single_period(row: InterventionDataForDateNormalizationRowSchema) → Date | None
Process a single period with the day, month or year precision.
source precised_numeric_start_date(row: InterventionDataForDateNormalizationRowSchema) → Date | None
Process a precise date in the format day/month/year.
source before_day_month(row: InterventionDataForDateNormalizationRowSchema) → Date | None
Return only the most recent day before which the intervention could happen.