open_period
¶
Parse opening months from camptocamp's free text access_period field.
Camptocamp has no structured opening data; the information is only available
as localized free text like "Mi-mars à fin mai et juillet à début septembre".
This module extracts month ranges from the common French, German, English and
Italian phrasings into AnswerEnum
values for OpenMonthlySchema.
Heuristics, deliberately conservative:
- months fully inside a range -> yes
- range edges qualified with mid/early (mi, début, early, Mitte, ...) -> yesish
- range start qualified with late (fin, late, Ende, ...) -> maybe
- anything unparseable stays unknown (the converter default)
Functions:
-
parse_open_months–Extract opening months from an
access_periodfree text.
Attributes:
-
demo–
Attributes¶
Classes¶
Functions¶
parse_open_months
¶
parse_open_months(text: str) -> dict[int, AnswerEnum]
Extract opening months from an access_period free text.
Returns a mapping month (1-12) -> answer; unmentioned months are left out.