aeat.core.parsing._dates module¶
Date string parsers for the two distinct input formats used across AEAT adapters.
Provides a unified _parse_date() helper that combines format selection with an error-policy axis.
The two variants are intentionally separate because they accept different wire formats:
_parse_iso8601_date()—YYYY-MM-DD(ISO 8601). Used wherever AEAT systems or profile storage serialises dates in the standard form (e.g. deadline-profile censo dates)._parse_ddmmyyyy_date()—DD-MM-YYYYorDD/MM/YYYY(day-first, separator is-or/). Used wherever the AEAT G313 (Mis Datos Censales) HTML page publishes dates in the Spanish day-first convention.
Both functions live at the core layer: they carry no domain dependencies,
perform no I/O, and raise ValueError so callers can wrap the error in
the domain-appropriate exception type.