IATA season utilities¶
These functions are pure Python (no database required). They are also available as static methods on both backend classes.
- eurocontrolpy.season_iata(year, season='summer')[source]¶
Start and end datetimes for an IATA season (both ends inclusive, UTC midnight).
- Parameters:
- Returns:
(start, end) as UTC-aware datetimes at midnight.
- Return type:
tuple[datetime,datetime]
Examples
>>> season_iata(2024, "summer") (datetime(2024, 3, 31, 0, 0, tzinfo=timezone.utc), datetime(2024, 10, 26, 0, 0, tzinfo=timezone.utc))
- eurocontrolpy.iata_season_for_date(date_input)[source]¶
Return the IATA season name for a given date.
- Parameters:
date_input (
str | datetime | date) – The date to check. Strings are parsed withdate.fromisoformat.- Returns:
‘summer-yyyy’ or ‘winter-yyyy’, where yyyy is the year of the summer season that defines the period (matches R package behaviour).
- Return type:
Examples
>>> iata_season_for_date("2024-06-15") 'summer-2024' >>> iata_season_for_date("2024-12-01") 'winter-2024' >>> iata_season_for_date("2024-01-15") 'winter-2023'